I would like to get bytes sent & received for each get request in a service.

I am aware of the issue in
https://issues.apache.org/jira/browse/HTTPCLIENT-1081 with HEAD requests,
and any request where getMetrics() is called after the connection has been
returned to the pool.

However, I get the impression that, as I extract the desired information
even before I process the entity in the response, I am not affected by that
problem.

I AM however affected by the fact that the metrics seem to represent the
total for that connection, rather than the total for the request-response
round that was just completed. That is a problem when working with
concurrent system with reused connections.

I thought I might try to work around this by caching the metrics before the
request as well as after, and saving the difference. This is, however, not
possible. I get a connectionshutdownexception (Exception in thread "3"
org.apache.http.impl.conn.ConnectionShutdownException), which I'm guessing
is down to the fact that I'm basically trying to use a connection that is at
that time still used by another thread (as it may have been leased to
another thread by the pool).

I'd be grateful for any pointers or guidance. 



--
View this message in context: 
http://httpcomponents.10934.n7.nabble.com/HttpConnection-getMetrics-per-request-tp23131.html
Sent from the HttpClient-User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscr...@hc.apache.org
For additional commands, e-mail: httpclient-users-h...@hc.apache.org

Reply via email to