HighLevel:
I have 3 filters configured for a servlet.I have to calculate average time taken by each filter.
Details:
1. I wrote a singleton object to maintain average times.
2. I am adding System.currentTime() in each filter doFilter() method start and end & at end setting these values to request.
3. In the
servlet, I am adding these times & incrementing the requests count in the singleton object.
Till this point it is working properly.
But, In the first filter starting, I have to send this counters values by reading from singleton object to some monitoring logs.
Here is the problem.
Parellel requests causing inconsistent time values... Any ideas please???