Isn't Filter.doFilter() called once for each incoming http request?
On Jul 31, 2014 10:24 AM, "Caldarale, Charles R" <chuck.caldar...@unisys.com>
wrote:

> > From: Igal @ getRailo.org [mailto:i...@getrailo.org]
> > Subject: Re: Programmatically retrieve number of tomcat connections
>
> > 1) you create a class that implements the Filter interface and maintains
> > the count in an AtomicLong object.
>
> > 2) you increment the AtomicLong before the call to chain.doFilter() and
> > decrement it after that call.
>
> This has nothing to do with the number of connections.
>
> > another way I can think of is to get all the threads in the JVM with
> > Thread.getAllStackTraces(), loop over them, and check their names for
> > example.
>
> Which also has little to do with the number of connections, especially
> when using NIO.
>
> You may be able to dig the number of connections out via an internal JMX
> call.  This is, of course, Tomcat specific, but avoids trying to invoke
> Tomcat's internal classes.
>
>  - Chuck
>
>
> THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
> MATERIAL and is thus for use only by the intended recipient. If you
> received this in error, please contact the sender and delete the e-mail and
> its attachments from all computers.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>

Reply via email to