You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Stefano Nichele <st...@gmail.com> on 2009/08/28 16:45:25 UTC

how many threads are serving requests ?

Hi All,
I'm collecting some monitor information via JMX and currently I'm 
interesting in how many threads are really serving requests.
My environment is composed by apache 2 + mod jk + tomcat 6.0.13.

Previously I monitored just::
Catalina:type=ThreadPool, attribute currentThreadsBusy
but it seems that using apache and mod_jk that value is not really what 
I'd like to monitor basically (I think) since persistent connections 
between apache and tomcat

What I'm doing now is something like:

        int count = 0;
        Set<ObjectName> processors = 
agent.queryMBeanNames("*:type=RequestProcessor,*");
        for (Iterator<ObjectName> itProcessors = processors.iterator(); 
itProcessors.hasNext();) {
            ObjectName processorName = itProcessors.next();
            String workerThreadName = (String) 
agent.getAttribute(processorName.getCanonicalName(), "workerThreadName");
           
            if (workerThreadName != null && !"".equals(workerThreadName)) {
                count ++;
            }

       }
        return count;

where "agent" is a mine class that works as wrapper around a jmx connection.

Mainly I count the number of "RequestProcessor" that have a not empty 
workerThreadName.

What do you think about that ? is there a quicker way ?

Thanks
ste


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org