You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "Angelov, Rossen" <Ro...@SourceMedia.com> on 2007/06/27 18:55:44 UTC

Tomcat Monitoring

What is recommended for monitoring Tomcat? Or is there anything built in
that can help monitoring the performance and the state of the thread
pools?

More specifically, I'm trying to find a way to time how long it take
from the moment a request was received and when the response was
returned.

Thanks,
Ross

"This communication is intended solely for the addressee and is confidential and not for third party unauthorized distribution"

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


Re: Tomcat Monitoring

Posted by Leon Rosenberg <ro...@googlemail.com>.
moskito.anotheria.net
and you are probably interested in the RequestURIFilter

http://moskito.anotheria.net/moskitodemo/mui/mskShowProducer?pProducerId=RequestURIFilter

regards
Leon


On 6/27/07, Angelov, Rossen <Ro...@sourcemedia.com> wrote:
> What is recommended for monitoring Tomcat? Or is there anything built in
> that can help monitoring the performance and the state of the thread
> pools?
>
> More specifically, I'm trying to find a way to time how long it take
> from the moment a request was received and when the response was
> returned.
>
> Thanks,
> Ross
>
> "This communication is intended solely for the addressee and is confidential and not for third party unauthorized distribution"
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

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


RE: Tomcat Monitoring

Posted by Tim Lucia <ti...@yahoo.com>.
> -----Original Message-----
> From: Angelov, Rossen [mailto:Rossen.Angelov@SourceMedia.com]
> Sent: Wednesday, June 27, 2007 12:56 PM
> To: Tomcat Users List
> Subject: Tomcat Monitoring
> 
> What is recommended for monitoring Tomcat? Or is there anything built in
> that can help monitoring the performance and the state of the thread
> pools?
> 
> More specifically, I'm trying to find a way to time how long it take
> from the moment a request was received and when the response was
> returned.

I have a suite of filters, one of which does exactly this.  Mixed in is a
display servlet which dumps out all requests, by URL including request
count, min, max and average request times.  PM me and I'll send it your way.

The main method looks like this, if you want to write your own:

    /**
     * Process the container's filter request.
     * @param request - Request object
     * @param response - response object
     * @param chain - next filter in the chain.
     */    
    public void doFilter(ServletRequest request, ServletResponse response,
                         FilterChain chain)
        throws IOException, ServletException 
    {
        hitCount++;
        HttpServletRequest httpRequest = (HttpServletRequest)request;
        final String context = httpRequest.getContextPath();
        String uri = httpRequest.getRequestURI();
        uri = uri.substring(context.length());

        URICount count = new URICount(uri, 1);
        synchronized (pages) {
            final int index = pages.indexOf(count);
            if (index < 0) { 
                pages.add(count);
            }
            else {
                count = (URICount)pages.get(index);
                count.increment();
            }
        }
        lastRequest = new Date();
        long t0 = System.currentTimeMillis();
        chain.doFilter(request, response);
        long t1 = System.currentTimeMillis();
        final long requestTime = t1-t0;
        count.addTotalTime(requestTime);
        processingTime += requestTime;
        maxProcessingTime = 
            (requestTime > maxProcessingTime ? requestTime :
maxProcessingTime);
        
        if (logger.isDebugEnabled()) {
            logger.debug(uri + " in " + (t1-t0) + " ms");
        }
    }

Tim



> 
> Thanks,
> Ross
> 
> "This communication is intended solely for the addressee and is
> confidential and not for third party unauthorized distribution"
> 
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org




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


RE: Tomcat Monitoring

Posted by Kirst Martin Wolfgang <MK...@PortolanCS.com>.
> What is recommended for monitoring Tomcat? Or is there anything built
in
> that can help monitoring the performance and the state of the thread
> pools?

For general purpose use jconsole.exe from SUN's JDK.

> More specifically, I'm trying to find a way to time how long it take
> from the moment a request was received and when the response was
> returned.

Hmm, maybe it's better to use performance analyzer like the 
"Test and Performance Tools Platform" (a.k.a. TPTP) from Eclipse.

Regards
 Martin

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