You could use a list of java.util.Dates with the oldest date at the beginning of the list and the newest at the end of the List. Push new Dates onto the list and pull (expired) dates from the front of the list accoring to your threshold.

The number of hits per unit time is the size of each list.

-Tim

tom ly wrote:

I need to display on a .jsp page the number of requests for Tomcat in the past 5 / 10 / 15/ 30 / 45 / 60 seconds. I've already implement a Filter will count the total number of requests. I did this with a static int, which is incremented everytime a request comes in. But what should I do so that I can show number of request over past time intervals? Since the present time is always changing, "the past n seconds" is constantly changing also.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to