- 浏览: 293225 次
- 性别:
- 来自: 北京
-
文章分类
最新评论
-
langzhe:
Mac 下用 sudo cpan Template,依然不能 ...
第一次 使用 tsung -
langzhe:
<server host='127.0.0.1' por ...
ejabberd/tsung 做压力测试万万不可忽视测试工具问题 -
dlliwei:
jabberd_register.xml 内容如下(我的ser ...
ejabberd/tsung 做压力测试万万不可忽视测试工具问题 -
dlliwei:
你好,我安装tsung后执行命令: tsung -f jabb ...
ejabberd/tsung 做压力测试万万不可忽视测试工具问题 -
bit1129:
这么复杂的一个东西,一句话说完了?
keepalive
相关文档 http://erlangdisplay.iteye.com/blog/318975
输出文件test.analyse 测试
Eshell V5.7.4 (abort with ^G) 1> fprof:trace([start,{file,test.trace}]). ok 2> fprof:trace(stop) 2> . ok ---------------------------------------- 3> fprof:profile([{file,test.trace}]). Reading trace data... .. End of trace! ok 4> fprof:analyse([{dest,test.analyse}]) 4> . Processing data... Creating output... Done! ok 5>
CNT表示总的函数调用次数,ACC表示Trace起始经历的时间,OWN是Trace中所有函数执行的时间和(不包含调用函数的执行时间),我们这个例子中OWN和ACC比较接近,因为我们这里在启动trace后就立即开始了函数调用,没有进行其他特殊的工作。这里时间的单位为ms。(来自相关文档 )
1 -module(chat). 2 -compile(export_all). 3 %-behaviour(gen_server). 4 start(N) -> 5 fprof:trace(start,"chat.trace"), 6 start_link(), 7 test(), 8 test(N), 9 testcast(), 10 fprof:trace(stop), 11 fprof:profile(file,"chat.trace"), 12 %fprof:analyse([{dest,"chat.analysis"}]). 13 fprof:analyse([{dest,"chat.analysis"},{callers,true},{sort,own}]), 14 io:format("11111111111~p~n",[whereis(chat)]). 15 16 test(0)-> 17 gen_server:call(?MODULE, {test,0}); 18 test(N)-> 19 gen_server:call(?MODULE, {test,N}), 20 test(N-1). 21 test()-> 22 chat ! {test,1}. 23 testcast() -> 24 gen_server:cast(?MODULE,castttt). 25 26 start_link() -> 27 gen_server:start_link({local,?MODULE},?MODULE,[],[]). 28 29 init([]) -> 30 {ok, {}}. 31 handle_cast(Msg,State) -> 32 tttt(), 33 io:format("cast=~p~n",[Msg]), 34 {noreply,State}. 35 36 handle_call({test,Number},From, State) when is_number(Number) -> 37 Reply = Number+1, 1,14 顶端
部分分析结果 1 %% Analysis results: 2 { analysis_options, 3 [{callers, true}, 4 {sort, own}, 5 {totals, false}, 6 {details, true}]}. 7 8 % CNT ACC OWN 9 [{ totals, 110269, 799.622, 736.349}]. %%% 10 11 12 % CNT ACC OWN 13 [{ "<0.33.0>", 110269,undefined, 736.349}]. %% 14 15 {[{{gen,do_call,4}, 10001, 276.089, 159.700}], 16 { {gen,wait_resp_mon,3}, 10001, 276.089, 159.700}, % 17 [{{erlang,demonitor,2}, 10001, 53.116, 53.116}, 18 {suspend, 9983, 63.273, 0.000}]}. 19 20 {[{{gen,call,4}, 10001, 499.306, 124.766}], 21 { {gen,do_call,4}, 10001, 499.306, 124.766}, % 22 [{{gen,wait_resp_mon,3}, 10001, 276.089, 159.700}, 23 {{erlang,send,3}, 10001, 53.294, 53.294}, 24 {{erlang,monitor,2}, 10001, 43.054, 43.054}, 25 {garbage_collect, 257, 2.103, 2.103}]}. 26 27 {[{{gen,call,3}, 10001, 617.283, 77.498}], 28 { {gen,call,4}, 10001, 617.283, 77.498}, % 29 [{{gen,do_call,4}, 10001, 499.306, 124.766}, 30 {{erlang,whereis,1}, 10001, 40.479, 40.479}]}. 31 32 {[{{chat,test,1}, 10000, 0.000, 72.848}, 33 {{chat,start,1}, 1, 798.851, 0.060}], 34 { {chat,test,1}, 10001, 798.851, 72.908}, % 35 [{{chat,test,1}, 10000, 0.000, 72.848}, 36 {{gen_server,call,2}, 10001, 725.943, 71.115}]}.
从手册上看到以下三种方式:
4.1 Profiling from the source code
- test.zip (6.1 KB)
- 下载次数: 4
发表评论
-
分析 mnesia 索引慢的问题,结果出乎意料.
2015-12-15 15:09 1415分析 mnesia 索引慢的� ... -
keepalive
2014-08-12 17:30 1317{keepalive, Boolean}(TCP/IP so ... -
erlang 手动回收内存
2014-01-20 16:39 1670%%% Garbage collection may ta ... -
Erlang内存分布
2014-01-17 20:18 2073此文来自:https://blog.heroku.com/ ... -
flush 方法小用和pid()方法
2014-01-08 19:23 10811> flush(). ok 2> Pi ... -
Erlang bit语法入门-1
2013-05-14 12:18 929Erlang bit语法入门 1> Red ... -
++操作与lists:concat操作比较 (lists:concat运算结果)
2013-04-11 14:53 1207测试环境 Linux jason-lxw 3.2.0-3 ... -
解决错误src/rabbit_networking.erl:49: type hostname() undefined
2013-02-21 12:31 1079使用 make USE_SPECS=false 参数编译 ... -
我的第一个escript
2013-02-21 11:38 9871 #!/usr/bin/env escript ... -
不要忽略任何一个错误提示,更要找到原因linked websocket controlling loop crashed with reason: kille
2013-02-20 14:29 1138开发程序的时候,好几次都看到后台打出下面的错误日志。 ... -
ets:update_counter实现数字循环
2013-01-18 17:33 2075首先初始化为1 ets:insert(?MODULE, ... -
Re 从表头合理取出host
2013-01-17 15:46 938hd(re:split(Host, ":" ... -
测试 erlang:monitor
2012-11-28 18:59 997测试代码 1 -module(testmonito ... -
lcnt工具
2012-11-20 13:54 770lcnt工具可以统计虚拟机内部的锁使用次数和冲突次数指导系统的 ... -
数字前面补零
2012-11-16 17:04 828lists:flatten(io_lib:fwrite(&qu ... -
get uuid
2012-11-02 10:56 12631、 string:strip(os:cmd("u ... -
apns推送
2012-10-26 11:51 1301%%%------------- ... -
make rel Command 'generate' not understood or not applicable
2012-09-21 11:14 1980今天 编译riak时遇到了 Command 'gene ... -
Did you notice the concept of "save queue"?
2012-09-14 17:36 642Did you notice the concept o ... -
Erlang截取中文问题
2012-08-20 15:06 1551NewSummary = xmerl_ucs:to_utf8( ...
相关推荐
PlugFprof 将fprof跟踪添加到Web应用程序的插件。用法在mix.exs添加到您的依赖mix.exs : defp deps do [{ :plug_fprof , " ~> 0.0.1 " }] end 然后在您的Plug / pheonix路由器中use它: defmodule MyRouter do use ...
描述该脚本将erlang的fprof输出转换为valgrind的callgrind输出。 要生成fprof输出,请使用fprof:analyse({dest, "outfile.fprof"}). 。 不要使用总计。 转换为callgrind很简单,只需键入: ./erlgrind_script ...
内容概述flame_prof是通用的Erlang探查器,有点像OTP的fprof ,除了... 它生成Linux 脚本(甚至在Win / macOS上),使用和分析。 它使用调用堆栈采样方法,而不是尝试测量每个单独的调用。 因此,它不需要使用Erlang...
- **检查时间和空间使用情况**:使用Haskell提供的工具(如`ghc -fprof-auto`和`ghc -fprof-latest`)来分析程序的时间和空间性能。 - **增加共享并最小化分配**:通过对计算结果进行适当的共享,可以减少内存分配和...
`-fprof-auto`和`-fhpc`可以开启性能分析和覆盖率报告,这对于发现代码中的热点和未充分利用的部分非常有用。 此外,`ghci`交互式环境也是一个强大的分析工具。我们可以在其中测试和运行代码片段,观察其行为,甚至...
通过启用特定的编译选项,例如`-prof`和`-fprof-auto`,开发者可以生成包含详细时间消耗和内存分配信息的分析报告。 2. **时间和分配报告** 这些报告通常以`.prof`文件的形式存在,包含了每个函数的调用次数、执行...