Stefan Parvu wrote:
Hi,
We are a small group of folks working on a measurement toolkit:
www.systemdatarecorder.org. One of the tools, webrec is supposed
to be a HTTP client measurement tool, recording the response
times for certain HTTP methods.
http://systemdatarecorder.org:9009/bugzilla/show_bug.cgi?id=21
The utility uses HTTPClient in a multithreaded way, see the specs for
webrec, one thread per workload.
I'm using ThreadSafeClientConnManager in my application. Now, I have
noticed in this mailing list is recommeded to use interceptors for
measuring metrics with HTTPClient.
Questions:
1) Do I have to use interceptor also measuring response time?
Can't I just use:
long pTime = System.currentTimeMillis();
long cTime = 0;
response = httpclient.execute(httpget);
if (response.getStatusLine().getStatusCode() ==
HttpURLConnection.HTTP_OK) {
cTime = System.currentTimeMillis();
}
long timeLapse = cTime - pTime;
You do not have to.
2). Does connection managers add some overhead to requests?
Yes, they do, but it is usually significantly lower than that of
establishing a new connection.
Why there is
a need to use interceptors?
Interceptors provide you with a finer control over the request execution
process, but you do not have to use them if you do not want to.
Oleg
Many thanks,
Stefan
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]