How can I intercept a Tomcat request at socket level?

Posted by Miguel Pardal on Stack Overflow See other posts from Stack Overflow or by Miguel Pardal
Published on 2010-04-13T14:42:04Z Indexed on 2010/04/13 15:12 UTC
Read the original article Hit count: 223

Filed under:
|
|
|
|

Hi,

I'm doing a performance study for a web application framework running on Apache Tomcat 6.

I'm trying to measure the time overhead of handling HTTP requests.

What I would like to do is:

/

// just before first request byte is read
long t1 = System.nanoTime();

// request is processed...

// just after final byte is written to response
long t2 = System.nanoTime();

/

Then I would compute the total time (t2 - t1).

Is there a way to do this? Thanks for your help!

© Stack Overflow or respective owner

Related posts about java

Related posts about apache