massemanet / eper

Erlang performance and debugging tools
MIT License
437 stars 128 forks source link

Add count results feature. #23

Closed maximvl closed 9 years ago

maximvl commented 10 years ago

It would be really nice to be able to know how many messages process received/sended in given amout of time, how many times function was called with particular arguments. Syntax could be like redbug:start("mod:critical_fun(X) when is_binary(X) -> count", [{time, 10000}]).

massemanet commented 10 years ago

redbug normally exits like this;

redbug done, timeout - 32

where the number (32 in this example) is the number of messages. But you want something else?

maximvl commented 10 years ago

Hm, I probably missed it while I was looking at output. This is ok to count messages, but then there should be a way to disable prints for each event and msgs option should not affect result, i.e. if there are very much events you shouldnt supply some kind of maximum value.

massemanet commented 10 years ago

you want a way to do nothing but count the messages? hmmm...

On Mon, Feb 10, 2014 at 8:48 PM, Maxim V notifications@github.com wrote:

Hm, I probably missed it while I was looking at output. This is ok to count messages, but then there should be a way to disable prints for each event and msgs option should not affect result, i.e. if there are very much events you shouldnt supply some kind of maximum value.

Reply to this email directly or view it on GitHubhttps://github.com/massemanet/eper/issues/23#issuecomment-34674143 .

maximvl commented 10 years ago

Yes, for me redbug is something that saves me from inserting logging here and there to find out what is happening in live system. And counting is probably on an edge between debug and profiling, but I found that I often need it.

massemanet commented 10 years ago

How about this; {timeout,Msgs}=redbug:start("erlang:monitor",[{time,6000},{msgs,1234},blocking]),length(Msgs).

On Tue, Feb 11, 2014 at 3:58 PM, Maxim V notifications@github.com wrote:

Yes, for me redbug is something that saves me from inserting logging here and there to find out what is happening in live system. And counting is probably on an edge between debug and profiling, but I found that I often need it.

Reply to this email directly or view it on GitHubhttps://github.com/massemanet/eper/issues/23#issuecomment-34761743 .