hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Silvia, Don" <Don.Sil...@FMR.com>
Subject How to measure response time with MultiThreadedHttpConnectionManager?
Date Fri, 21 Apr 2006 16:38:44 GMT

I'm trying to measure response times in an application that uses
MultiThreadedHttpConnectionManager.  I tried just wrapping the call to
HttpClient.executeMethod with calls to System.currentTimeMillis():

    MultiThreadedHttpConnectionManager connMgr = new
    HttpClient client = new HttpClient(connMgr);
    long startTime = System.currentTimeMillis();
    client.executeMethod(method);  // method is a PostMethod
    long elapsed = System.currentTimeMillis() - startTime;

But what I'm seeing is that the threads all start up and mark the start
time, then the threads appear to be interrupted during executeMethod.
The result is that the measured times get progressively longer, with the
last thread to finish reporting a time almost as long as the entire
application's run time.

Is there any way to get accurate response times in a multi threaded

I'm using HttpClient 2.0.2 in my application but I tried the
multi-threaded example with HttpClient 3.0 and got the same results.  


Don Silvia

To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpclient-user-help@jakarta.apache.org

View raw message