This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
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 Murach's Java Servlets and JSP this week in the Servlets 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
Getting my desktop's time ?
how to get the request parameter in a Post method of form enctype=multipart/form-data
How to measure responsetime of network using JAVA?
servlet calling EJB
Rhino with Tomcat server