aspose file tools*
The moose likes Servlets and the fly likes how to get the server processing time Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "how to get the server processing time" Watch "how to get the server processing time" New topic
Author

how to get the server processing time

madhu gadde
Greenhorn

Joined: May 27, 2005
Posts: 11
Hi all,

I need to know how long the server/servlet has taken to process a particular request. Could anybody help me in finding the servlet's processing time.

Thanks in Advance
Madhu Gadde
Satish Chilukuri
Ranch Hand

Joined: Jun 23, 2005
Posts: 266
Have a filter intercept the Request. Note the time before and after invoking the doFilter method. The difference will give you the processing time for the request. But this won't include the network delay.
John Dunn
slicker
Ranch Hand

Joined: Jan 30, 2003
Posts: 1108
put this in doGet():

long appStartTime = System.currentTimeInMillis();

Now any time you want a time marker you subtract appStartTime from System.currentTimeInMillis();

I get one buffer at start of doGet(), put log messages in along the way with an elapsed time and print once at the end. This way I can filter the log file for specific log points and get the elapsed time.


"No one appreciates the very special genius of your conversation as the dog does."
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to get the server processing time
 
Similar Threads
Rhino with Tomcat server
servlet calling EJB
Getting my desktop's time ?
How to measure responsetime of network using JAVA?
how to get the request parameter in a Post method of form enctype=multipart/form-data