How do I make "simple" throughput servlet-filter?
- by Tommy
I'm looking to create a filter that can give me two things: number of request pr minute, and average responsetime pr minute. I already got the individual readings, I'm just not sure how to add them up.
My filter captures every request, and it records the time each request takes:
public void doFilter(ServletRequest request, ...()
{
long start = System.currentTimeMillis();
chain.doFilter(request, response);
long stop = System.currentTimeMillis();
String time = Util.getTimeDifferenceInSec(start, stop);
}
This information will be used to create some pretty Google Chart charts. I don't want to store the data in any database. Just a way to get current numbers out when requested
As this is a high volume application; low overhead is essential.
I'm assuming my applicationserver doesn't provide this information.