You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@geronimo.apache.org by Sangjin Lee <sj...@gmail.com> on 2008/01/17 02:45:32 UTC

[AsyncHttpClient] data collection & instrumentation

I'd like to propose changes to enable some basic stat collection and/or
instrumentation to have visibility into performance of AHC.  For a given
AsyncHttpClient, one might want to know metrics like
- total request count
- total success count
- total exception count
- total timeout count
- connection attempt count
- connection failure count
- connect time average
- connection close count
- average response time (as measured from the invocation time to having the
response ready)
- and others?

Collecting these metrics should have little effect on the overall
performance.  There would be an API to access these stats.

I was initially thinking of an IoFilter to consolidate these hooks, but I
realize some of these metrics are not readily available to an IoFilter (e.g.
connect-related numbers).  It might be unavoidable to spread the
instrumentation in a couple of places (IoHandler, ConnectFutureListener,
etc.).

Taking this one step further, one might think of callbacks or listeners for
various key events such as connect complete, request sent, etc., so callers
can provide instrumenting/logging code via event notification.  However, I
think this should be used judiciously as such injected code may cause havoc.

Thoughts?  Suggestions?

Thanks,
Sangjin