001    /**
002     *  Licensed to the Apache Software Foundation (ASF) under one or more
003     *  contributor license agreements.  See the NOTICE file distributed with
004     *  this work for additional information regarding copyright ownership.
005     *  The ASF licenses this file to You under the Apache License, Version 2.0
006     *  (the "License"); you may not use this file except in compliance with
007     *  the License.  You may obtain a copy of the License at
008     *
009     *     http://www.apache.org/licenses/LICENSE-2.0
010     *
011     *  Unless required by applicable law or agreed to in writing, software
012     *  distributed under the License is distributed on an "AS IS" BASIS,
013     *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014     *  See the License for the specific language governing permissions and
015     *  limitations under the License.
016     */
017    package org.apache.geronimo.management.geronimo.stats;
018    
019    import javax.management.j2ee.statistics.Stats;
020    import javax.management.j2ee.statistics.RangeStatistic;
021    import javax.management.j2ee.statistics.TimeStatistic;
022    import javax.management.j2ee.statistics.CountStatistic;
023    
024    /**
025     * Statistics exposed by a web container (for the container as a whole, not
026     * a particular servlet/JSP/URL).
027     *
028     * todo: confirm the definitions of the Jetty stats included here; verify these are valid for Tomcat as well
029     *
030     * @version $Revision: 1.0$
031     */
032    public interface WebContainerStats extends Stats {
033        /**
034         * Gets the total number of connections thus far
035         */
036        CountStatistic getTotalConnectionCount();
037     
038        /**
039         * Gets the number of connections currently open (as well as the min and
040         * max since statistics gathering started).
041         */
042        RangeStatistic getOpenConnectionCount();
043    
044        /**
045         * Gets the number of requests handled by a particular connection (as well
046         * as the min and max since statistics gathering started).
047         */
048        RangeStatistic getConnectionRequestCount();
049    
050        /**
051         * Gets the legnth of time that connections have been open (includes
052         * figures across all connections open at present)
053         */
054        TimeStatistic getConnectionDuration();
055    
056        /**
057         * Gets the number of errors that have been returned since statistics
058         * gathering started.
059         */
060        CountStatistic getTotalErrorCount();
061    
062        /**
063         * Gets the number of requests that have been processed since statistics
064         * gathering started.
065         */
066        CountStatistic getTotalRequestCount();
067    
068        /**
069         * Gets the number of requests being processed concurrently (as well
070         * as the min and max since statistics gathering started).
071         */
072        RangeStatistic getActiveRequestCount();
073    
074        /**
075         * Gets the legnth of time taken to process a request (includes
076         * figures across all requests since statistics gathering started)
077         */
078        TimeStatistic getRequestDuration();
079    
080        /**
081         * Gets the current state of statistics collection (on or off)
082         */
083        boolean isStatsOn();
084    }