statistics snapshots every x minutes

56 views
Skip to first unread message

cld.sanchez

unread,
Feb 22, 2012, 10:27:42 AM2/22/12
to javasimon
Hello, I'm trying to take statistics snapshots every x minutes and
write them in a log. The idea is to get something similar to the
result of the perf4j log parser. This is an example log:

Simon key=/server/url1.do, hits=1.0, avg=20.0, total=20.0, min=20.0,
max=20.0, first=Wed Feb 22 09:23:57 EST 2012, last=Wed Feb 22 09:23:57
EST 2012
Simon key=/server/url2.do, hits=5.0, avg=10.0, total=50.0, min=5.0,
max=15.0, first=Wed Feb 22 09:23:17 EST 2012, last=Wed Feb 22 09:25:57
EST 2012

I want to known if there is a way to do this. I have configured the
simon web filter, the jdbc driver and I have intercepted some methods
using spring and every works fine. On the other hand I have a process
that run every x minutes (this process have to log the monitor of the
last x minutes).
But I don't known how to take snapshots (i.e summaries of the last x
minutes)

Thanks, Claudio.

Richard Richter

unread,
Feb 22, 2012, 11:51:39 AM2/22/12
to java...@googlegroups.com
Hi Claudio

Right now there is no out of box solution, so you have to code something more into your task and use Simon.sample or sampleAndReset (depends if you want to track values or "rates" sort of). You can use SimonManager.getSimons(pattern - can be null for all) to get Simons you want.

Talking about Perf4J, look at our example with Perf4J like callback. If you want, you may log every Stopwatch.stop in a Perf4J way and process it with Perf4J tools.

Virgo


--
You received this message because you are subscribed to the Google Groups "javasimon" group.
To post to this group, send email to java...@googlegroups.com.
To unsubscribe from this group, send email to javasimon+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/javasimon?hl=en.


cld.sanchez

unread,
Feb 22, 2012, 10:13:40 PM2/22/12
to javasimon
Thanks Virgo!

SimonManager.getSimons(null) and simon.sampleAndReset works like a
charm.

Regards, Claudio.
Reply all
Reply to author
Forward
0 new messages