- 浏览: 279302 次
- 性别:
- 来自: 北京
文章分类
最新评论
-
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://www.erlang.org/doc/man/eprof.html
A Time Profiling Tool for Erlang
主要API R14B 比R13B提供了更多的API
start/0,
start_profiling/1
stop_profiling/0
profile/2..
analyse/0,
total_analyse/0
log/0
23 test(N)-> 24 {ok, Epid}=eprof:start(), %启动 25 Pid = spawn(?MODULE, hello, []), 26 profiling = eprof:start_profiling([Pid]), %启动 27 test(N,Pid), %执行被分析的程序 28 eprof:stop_profiling(), 29 % eprof:analyse(), eprof:log(test), %将分析结果生成文件: 30 eprof:total_analyse(), %分析结果 31 eprof:stop(). %停止 34 test(0,_Pid) -> 35 ok; 36 test(N,Pid) -> 37 send(Pid), 38 test(N-1,Pid). 39 40 send(Pid) -> 41 Pid ! {self(),test}, 42 loop(). 51 hello() -> 52 % Pid1 = spawn(?MODULE, hello1, []), 53 % loop(), 54 t(), 55 %Pid1 ! {self(),test}, 56 receive 57 {P,test} -> 58 P ! returnok, 59 hello() 60 end. 61 t() -> 62 ok. 66 loop() -> 67 receive 68 T -> 69 T, 70 loop() 71 after 500 -> 72 timeout 73 end. ~
测试分析结果:
7> test_eprof:test(20). eprof: Starting profiling ..... eprof: Stop profiling FUNCTION CALLS TIME test_eprof:hello/0 20 80 % test_eprof:t/0 20 20 % Total time: 0.00 Measurement overhead: 0.00 stopped 8>
注意此方法的位置:是在analyse/0和total_analyse前面。否则日志里面没有数据
Types:
File = atom() | string()
This function ensures that the results displayed by analyse/0 and total_analyse/0 are printed both to the file File and the screen
(1)eprof:start_profiling([self()]),分析结果无法搜集到chat:handle_info chat:handle_cast chat:handle_call (2)eprof:start_profiling([chat]), 分析结果无法搜集到chat:handle_info chat:handle_cast 出现问题的原因: Sending a message (handled by handle_info) or doing a cast (handled by handle_cast) are both async. You are stopping the profiler too early.Changing the order to do the async operations first, then the sync one should assure that all the requests have been handled before you stop eprof我添加seelp试过,问题搞定! -module(chat). -compile(export_all). %-behaviour(gen_server). start(N) -> start_link(), eprof:start(), eprof:start_profiling([self()]), test(N), testcast(), test(), eprof:stop_profiling(), eprof:log(chat), eprof:analyse(), eprof:total_analyse(). test(N)-> gen_server:call(?MODULE, {test,N}). test()-> chat ! {test,1}. testcast() -> gen_server:cast(?MODULE,castttt). start_link() -> gen_server:start_link({local,?MODULE},?MODULE,[],[]). init([]) -> {ok, {}}. handle_cast(Msg,State) -> tttt(), io:format("cast=~p~n",[Msg]), {noreply,State}. handle_call({test,Number},From, State) when is_number(Number) -> Reply = Number+1, {reply, Reply,State}; handle_call(_,From, State) -> Reply = numerror, {reply, Reply,State}. handle_info(Ino,State) -> tttt(), io:format("info=~p~n",[Ino]), {noreply,State}. tttt() -> ok.
- test.zip (263 Bytes)
- 下载次数: 12
发表评论
-
分析 mnesia 索引慢的问题,结果出乎意料.
2015-12-15 15:09 1309分析 mnesia 索引慢的 ... -
keepalive
2014-08-12 17:30 1207{keepalive, Boolean}(TCP/IP so ... -
erlang 手动回收内存
2014-01-20 16:39 1574%%% Garbage collection may ta ... -
Erlang内存分布
2014-01-17 20:18 1980此文来自:https://blog.heroku.com/ ... -
flush 方法小用和pid()方法
2014-01-08 19:23 9921> flush(). ok 2> Pi ... -
Erlang bit语法入门-1
2013-05-14 12:18 869Erlang bit语法入门 1> Red ... -
++操作与lists:concat操作比较 (lists:concat运算结果)
2013-04-11 14:53 1154测试环境 Linux jason-lxw 3.2.0-3 ... -
解决错误src/rabbit_networking.erl:49: type hostname() undefined
2013-02-21 12:31 1001使用 make USE_SPECS=false 参数编译 ... -
我的第一个escript
2013-02-21 11:38 9241 #!/usr/bin/env escript ... -
不要忽略任何一个错误提示,更要找到原因linked websocket controlling loop crashed with reason: kille
2013-02-20 14:29 1077开发程序的时候,好几次都看到后台打出下面的错误日志。 ... -
ets:update_counter实现数字循环
2013-01-18 17:33 2029首先初始化为1 ets:insert(?MODULE, ... -
Re 从表头合理取出host
2013-01-17 15:46 880hd(re:split(Host, ":" ... -
测试 erlang:monitor
2012-11-28 18:59 942测试代码 1 -module(testmonito ... -
lcnt工具
2012-11-20 13:54 708lcnt工具可以统计虚拟机内部的锁使用次数和冲突次数指导系统的 ... -
数字前面补零
2012-11-16 17:04 709lists:flatten(io_lib:fwrite(&qu ... -
get uuid
2012-11-02 10:56 12111、 string:strip(os:cmd("u ... -
apns推送
2012-10-26 11:51 1135%%%------------- ... -
make rel Command 'generate' not understood or not applicable
2012-09-21 11:14 1869今天 编译riak时遇到了 Command 'gene ... -
Did you notice the concept of "save queue"?
2012-09-14 17:36 595Did you notice the concept o ... -
Erlang截取中文问题
2012-08-20 15:06 1438NewSummary = xmerl_ucs:to_utf8( ...
相关推荐
NULL 博文链接:https://room-bb.iteye.com/blog/2290355
where is the energy spent inside my app fine grained energy accounting on smartphones with eprof.发表于Eurosys 2012,被引用34次。
波士顿房价数据集Boston House Price 全网最便宜
三种实现FPGA实现UDP协议的代码工程(包括ARP、ICMP),包含使用设计文档。 第一种,米联客的DCP封装包 第二种,正点原子的源码工程 第三种,基于正点原子的赛灵思MAC核的代码工程。
Red_Hat_Enterprise_Linux-7-RPM_Packaging_Guide-en-US
Matlab 三维人脸识别系统 V 4.3.zip
信捷XD PLC MODBUS控制阀岛通信 案例程序
大家好呀!今天来介绍一款常用进制转换器,也就是 16 进制、10 进制、2 进制转换计算器。有了它,你可以轻松实现不同进制之间的快速转换。无论是将 16 进制转换为 10 进制或 2 进制,还是从其他进制转换过来,它都能准确而高效地完成。无论是在计算机编程、数字电路等领域,还是日常对进制转换有需求的时候,它都能成为你的得力小助手,让进制转换不再麻烦,快来试试吧!
这款微信小程序是一个创新的智能排队取号系统,专为提高服务行业的效率和顾客满意度而设计。它通过集成地图组件,为用户提供了一个直观、易用的排队和取号解决方案。用户可以在小程序中查看各个服务点的位置,实时了解排队情况,并进行远程取号。 小程序的主要功能包括: 实时排队信息:用户可以实时查看各个服务点的排队情况,包括当前排队人数、预计等待时间等。 远程取号:用户无需到现场即可通过小程序远程取号,节省了排队等待的时间。 地图导航:集成的地图组件可以帮助用户快速找到服务点的具体位置,并提供导航服务。 取号管理:用户可以在小程序中管理自己的取号信息,包括查看、取消等操作。 此外,小程序还支持多种场景,如餐饮、医疗、银行、政府服务等,适用于各种需要排队取号的服务场合。它不仅提高了服务效率,减少了顾客的等待时间,还为商家提供了客流管理和数据分析的工具。
520节日520节日表白神器520节日520节日表白神器520节日520节日表白神器520节日520节日表白神器
JAVA语言考试系统的设计与实现(LW+源代码+文献综述+外文翻译+开题报告)
相移法偏移MATLAB代码.zip
directx修复工具directx修复工具directx修复工具directx修复工具
基于matlab的三维地球建模,需联网.zip
字符串处理-I.MX6U嵌入式Linux C应用编程学习笔记基于正点原子阿尔法开发板
参加比赛的一些心得:感觉把比赛得那一门语言基础学会,输入输出([我写的python输入输出](https://blog.csdn.net/qq_41392228/article/details/123614298)),([C++的STL](https://blog.csdn.net/qq_41392228/article/details/124825895)),熟练里面的数据结构,如数组,map等,==主要还是基础==。熟悉了后,可以在刷一下基础题,巩固哈学了的基础知识。把基础学好了,拿个奖是没问题的,正常发挥即可。想那个好的名词,就要看看相关的算法了,主要就是暴力的+优化,BFS,DFS,比较难的就是动态规划,得找转换方程。 python版本的可见:https://blog.csdn.net/qq_41392228/article/details/123616441
基于 Rust + eBPF 丢弃 GFW DNS 污染包 GFW 污染 DNS 的方式为抢答,我们只需要丢弃投毒响应即可获得正确的解析结果。通过 eBPF 我们可以在内核中插入代码,相比在用户态启动代理,这样可以获得更好的性能。 要丢弃投毒响应,重点是找到它们的特征。 以 twitter.com 为例,当向 8.8.8.8 请求 twitter.com 的 A 记录时,正常的响应会返回 2 条结果(1Q2A);而 GFW 只会返回 1 条,但是使用了 2 次抢答。2 次抢答包其中一个 IP Identification = 0x0000,另一个 IP Flags = 0x40(Don't fragment);而正常的响应 IPID 不会是 0 并且 IP Flags = 0。 我们只要 Drop 掉符合对应特征的包即可。这时我们可以验证,twitter.com 可以正确解析(fb 等非 google 服务也正常)。