"Edmon Begoli" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
> Hi,
>
> This question is directed towards Tomcat developers or Tomcat API experts.
>
> We are trying to establish an inspection mechanism that will track key
> parameters
> of Tomcat's over the period of time including severe peaks and low usage
> times.
>
> The key parameters that we interested in are:
>
>
>   - Current number of threads that are servicing web requests on the
>   HTTP or AJP connector,
>

Easily done with a Valve:  Just increment the counter on entry and decrement 
it on exit.  But be certain to use java.util.concurrent (or a sync block) if 
you absolutely need the count to be accurate.

>
>
>   - Current number of database connections utilized
>
>

If you are using Tomcat's DataSource, then you should be able to get it from 
http://jakarta.apache.org/commons/dbcp/apidocs/org/apache/commons/dbcp/BasicDataSource.html#getNumActive().
 
Note that Tomcat repackages this as o.a.t.dbcp.dbcp.BasicDataSource.

Otherwise, consult your provider's documentation.

>
>   - Current size of the backlog queue of waiting http/ajp requests
>

Tomcat doesn't expose it's ServerSockets, and even if it did it wouldn't 
help.  You'll need to get this probably externally in an O/S dependant way.

>
> We want to output these parameter on a periodic basis, say every 30 sec so
> that we can track the Tomcat's
> behavior over time and over different loads.
>
>
> I am aware of MBean server and how to access it via tool like JConsole.
>
> However, use of the JConsole on the hardened environement where only JRE 
> is
> used
> and where only few ports are open is not feaseable. Plus, it provides a
> snapshot and not aggregate data.
>
> What we would like to do/have is some form of a Tomcat valve or simply
> a separate component that is periodically dumping these values that I 
> listed
> above.
>
>
> Can someone please advise me on the appropriate API, preferably directly
> accessible and not via JMX that would enable me to get that information.
>
> -- 
> Thank you,
> Edmon Begoli
> http://blogs.ittoolbox.com/eai/software
> 




---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to