> On Sep 14, 2017, at 10:44 PM, Simone Bordet <[email protected]> wrote:
> 
> Hi,
> 
> On Thu, Sep 14, 2017 at 7:47 PM, Steven Schlansker
> <[email protected]> wrote:
>> I'm going through the process of upgrading from Apache HttpClient 4 to Jetty 
>> HttpClient -- we got tired
>> of dealing with terrible APIs and wanted asynchronous support :)
>> 
>> One thing I've not been able to figure out is how do I instrument the Jetty 
>> client to get
>> statistics out - number of connections used / available in pools; open 
>> connections
>> to each destination versus the limit, etc.
>> 
>> Didn't see a mention in the docs nor any obvious API, but I'm sure I'm just 
>> missing it.
> 
> This information is automatically exposed to JMX when using Jetty's
> JMX facilities.
> 
> Otherwise it is obtainable by downcasting to concrete classes:
> 
> HttpDestination destination = (HttpDestination)httpClient.getDestination(...);
> DuplexConnectionPool connectionPool =
> (DuplexConnectionPool)destination.getConnectionPool();
> 
> You may get different concrete classes based on the transport you have
> chosen, so maybe you need additional "instanceof" around.
> 
> HttpDestination and DuplexConnectionPool (and their parent classes)
> have methods annotated with @ManagedAttribute and those are exported
> to JMX and are probably those you're interested in.


Thanks!  JMX is great but we want to expose it over our own transport;
the magic downcasts were what I was missing.

Attachment: signature.asc
Description: Message signed with OpenPGP using GPGMail

_______________________________________________
jetty-users mailing list
[email protected]
To change your delivery options, retrieve your password, or unsubscribe from 
this list, visit
https://dev.eclipse.org/mailman/listinfo/jetty-users

Reply via email to