geronimo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Greg Wilkins <gr...@mortbay.com>
Subject Re: Statistics Management and Jetty/Tomcat
Date Sun, 04 Dec 2005 05:46:29 GMT
Joe Bohn wrote:

> That's correct.  In fact, at the moment I'm just trying to get a more
> generic management implementation of the container stats in the style of
> the JSR77 stats ... but I'm not really looking for the JSR77 servlet
> stats right now.   You mentioned in another note that you were hoping to
> create a new jetty image soon.

Yep - I'd like to get a 5.1.7 out by mid week before apachecon.
So I'll add these methods today and make a snapshot. If you can test ASAP
that will help with the timing.

> I think our needs to complete what we are already receiving in part from
> Jetty would be met if you could provide these container statistics:
> - getConnectionsOpenMin
> - getConnectionsRequestsMin
> - getConnectionsRequestsCurrent
> - getConnectionsDurationMin
> - getConnectionsDurationCount
> - getConnectionsDurationTotal
> - getRequestsActiveMin
> - getRequestsDurationMin
> - getRequestsDurationCount
> - getRequestsDurationTotal

I'm not sure all these make sense?   ConnectionsRequests is
a stat about the number of requests per connection (OK badly named),
as such there is no current value.  Also the getRequestsActiveMin is going
to be zero - unless you have a stats reset method that can be called on a busy
server.

Also some of the Counts and Totals are already provided (eg RequestDurationCount
is just the number of requests).


So would you be OK with the following stats:
    
    private transient long _statsStartedAt=0;            // time stats collection started
    
    private transient int _connections;                  // total number of connections made
to server
    
    private transient int _connectionsOpen;              // number of connections currently
open
    private transient int _connectionsOpenMin;           // min number of connections open
simultaneously
    private transient int _connectionsOpenMax;           // max number of connections open
simultaneously
    
    private transient long _connectionsDurationMin;      // min duration of a connection
    private transient long _connectionsDurationMax;      // max duration of a connection
    private transient long _connectionsDurationTotal;    // total duration of all coneection
    

    private transient int _errors;                       // total bad requests to the server
    private transient int _requests;                     // total requests made to the server

    private transient int _requestsActive;               // number of requests currently being
handled
    private transient int _requestsActiveMin;            // min number of connections handled
simultaneously
    private transient int _requestsActiveMax;            // max number of connections handled
simultaneously
    
    private transient int _connectionsRequestsMin;       // min requests per connection
    private transient int _connectionsRequestsMax;       // max requests per connection

    private transient long _requestsDurationMin;         // min request duration
    private transient long _requestsDurationMax;         // max request duration
    private transient long _requestsDurationTotal;       // total request duration
    
    
I'm assuming yes and have started updating Jetty    


> There is one other matter regarding how stats are enabled/disabled.  I
> don't see in the JSR77 spec where this type of processing is available.
>  It looks like stats are always presumed to be active.  However, since
> the jetty stats can be enabled and disabled at any time I've been
> thinking of extending the JSR77-like container stats to also include the
> notion of enabling and disabling the collect of statistics in the
> WebContainerStats interface.  Are there thoughts from those that are
> better versed in JSR77 about the ability to enable/disable the
> collection of stats?

It is important to be able to disable stats collection.  Stats are expensive as
they represent an extra sync lock that all requests must grab several times 
during processing (oh for a atomic ++ in java 1.4)

If you want the min values, then a reset is also worth while.


cheers








Mime
View raw message