jQuery in Action, 2nd edition*
The moose likes JSP and the fly likes jsp response 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 » JSP
Bookmark "jsp response time" Watch "jsp response time" New topic
Author

jsp response time

tony al
Greenhorn

Joined: Jul 03, 2002
Posts: 8
hi,
I am interested in measuring the response time for a jsp i.e; the time between the instant the request is received by the JSP, to the instant the result in html in produced(on server side). Note that this does not include the network transmission time.
I tried using simple system.currenttimemillis() at the start and end of the jsp; but this does not given me the right values.
Any help in this in highly appreciated.
Thanks
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12760
    
    5
Thats the only call to get system time. Why do you think it is not working?
Bill
tony al
Greenhorn

Joined: Jul 03, 2002
Posts: 8
Hi,
I am actually interested in finding the variation in the jsp response time as the load on the jsp increases. But, I am not noticing any difference in jsp response time with increase in load, using my current method. I think this is because I am not taking into account the wait time between when the http request was recevied to when the actual processing of the jsp began. I do notice that the jsp output is much slower with increase in load, but the response time using my current method remains the same.
So if there was a way to find the time when the actual HTTP request was received, rather than just when the jsp processing started(as done by using the system.currenttimeinmillis at the beginning of the jsp), I think I would find a solution to this.
Thanks for your help
Frank Carver
Sheriff

Joined: Jan 07, 1999
Posts: 6920
Which JSP container are you using? If you have the source code you could probably put time logging in the network protocol handling code.
In practice, though, the obvious way is to use one of the many tools which measure remotely and include the network latency in the total. That's what matters to users, after all.


Read about me at frankcarver.me ~ Raspberry Alpha Omega ~ Frank's Punchbarrel Blog
Ashok Haluvarthi
Greenhorn

Joined: Jul 04, 2002
Posts: 13
Hello Sir,
Take this
u place this at the start of ur jsp page
<%
long stime = System.currentTimeMillis();
%>
//statement or data..any thing...

last
<%
long etime = System.currentTimeMillis();
double elapsed = (etime - stime)/1000.0;
%>
try it out...
byeeeee
 
Consider Paul's rocket mass heater.
 
subject: jsp response time
 
Similar Threads
What is server side pushing
Why I can't upload the assignment?
DB Connection object tracking
Suggestion: larger search button
Is Rails easy to learn