Re: How can I display number of requests over the past n seconds?

2004-08-04 Thread Rodrigo Ruiz
Mmmm, I think people is answering more than one question ;-) If you need to be strict with respect to the timings, that is, you need exactly the number of requests in the past five seconds counting from the moment your request is done, you will need the solution proposed by Tim. Just remember

Re: How can I display number of requests over the past n seconds?

2004-08-02 Thread Justin Ruthenbeck
More academic exercise than recommendation, but... Write your own implementation of a Map/HashMap specific to java.util.Date objects. Identify your smallest time increment (5 seconds in your email). Identify largest time increment (60 seconds) Create (60/5)+1 buckets for your hash function

How can I display number of requests over the past n seconds?

2004-07-29 Thread tom ly
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

Re: How can I display number of requests over the past n seconds?

2004-07-29 Thread Tim Funk
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

RE: How can I display number of requests over the past n seconds?

2004-07-29 Thread Shapira, Yoav
display number of requests over the past n seconds? 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