You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by am...@apache.org on 2005/10/30 14:48:16 UTC

svn commit: r329565 - in /geronimo/trunk/modules: jetty/ jetty/src/java/org/apache/geronimo/jetty/ management/src/java/org/apache/geronimo/management/geronimo/stats/ management/src/java/org/apache/geronimo/management/stats/

Author: ammulder
Date: Sun Oct 30 05:47:59 2005
New Revision: 329565

URL: http://svn.apache.org/viewcvs?rev=329565&view=rev
Log:
Placeholder for web container stats

Added:
    geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/JettyWebContainerStatsImpl.java
    geronimo/trunk/modules/management/src/java/org/apache/geronimo/management/geronimo/stats/
    geronimo/trunk/modules/management/src/java/org/apache/geronimo/management/geronimo/stats/WebContainerStats.java
Modified:
    geronimo/trunk/modules/jetty/project.xml
    geronimo/trunk/modules/management/src/java/org/apache/geronimo/management/stats/StatisticImpl.java

Modified: geronimo/trunk/modules/jetty/project.xml
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/jetty/project.xml?rev=329565&r1=329564&r2=329565&view=diff
==============================================================================
--- geronimo/trunk/modules/jetty/project.xml (original)
+++ geronimo/trunk/modules/jetty/project.xml Sun Oct 30 05:47:59 2005
@@ -128,6 +128,12 @@
 
         <dependency>
             <groupId>geronimo-spec</groupId>
+            <artifactId>geronimo-spec-j2ee-management</artifactId>
+            <version>${geronimo_spec_j2ee_management_version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>geronimo-spec</groupId>
             <artifactId>geronimo-spec-j2ee-deployment</artifactId>
             <version>${geronimo_spec_j2ee_deployment_version}</version>
         </dependency>

Added: geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/JettyWebContainerStatsImpl.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/JettyWebContainerStatsImpl.java?rev=329565&view=auto
==============================================================================
--- geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/JettyWebContainerStatsImpl.java (added)
+++ geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/JettyWebContainerStatsImpl.java Sun Oct 30 05:47:59 2005
@@ -0,0 +1,106 @@
+package org.apache.geronimo.jetty;
+
+import javax.management.j2ee.statistics.RangeStatistic;
+import javax.management.j2ee.statistics.TimeStatistic;
+import javax.management.j2ee.statistics.CountStatistic;
+import org.apache.geronimo.management.geronimo.stats.WebContainerStats;
+import org.apache.geronimo.management.stats.RangeStatisticImpl;
+import org.apache.geronimo.management.stats.TimeStatisticImpl;
+import org.apache.geronimo.management.stats.CountStatisticImpl;
+import org.apache.geronimo.management.stats.StatsImpl;
+import org.apache.geronimo.management.stats.StatisticImpl;
+
+/**
+ * Jetty implementation of the Geronimo stats interface WebContainerStats
+ *
+ * @version $Revision: 1.0$
+ */
+public class JettyWebContainerStatsImpl extends StatsImpl implements WebContainerStats {
+    private RangeStatisticImpl openConnectionCount;
+    private RangeStatisticImpl connectionRequestCount;
+    private TimeStatisticImpl connectionDuration;
+    private CountStatisticImpl totalErrorCount;
+    private CountStatisticImpl totalRequestCount;
+    private RangeStatisticImpl activeRequestCount;
+    private TimeStatisticImpl requestDuration;
+
+    public JettyWebContainerStatsImpl() {
+        openConnectionCount = new RangeStatisticImpl("Open Connections", StatisticImpl.UNIT_COUNT,
+                "The number of connections open at present");
+        connectionRequestCount = new RangeStatisticImpl("Connection Request Count", StatisticImpl.UNIT_COUNT,
+                "The number of requests handled by a particular connection");
+        connectionDuration = new TimeStatisticImpl("Connection Duration", StatisticImpl.UNIT_TIME_MILLISECOND,
+                "The legnth of time that individual connections have been open");
+        totalErrorCount = new CountStatisticImpl("Error Count", StatisticImpl.UNIT_COUNT,
+                "The number of reponses that were errors since statistics gathering started");
+        totalRequestCount = new CountStatisticImpl("Request Count", StatisticImpl.UNIT_COUNT,
+                "The number of requests that were handled since statistics gathering started");
+        activeRequestCount = new RangeStatisticImpl("Active Request Count", StatisticImpl.UNIT_COUNT,
+                "The number of requests being processed concurrently");
+        requestDuration = new TimeStatisticImpl("Request Duration", StatisticImpl.UNIT_TIME_MILLISECOND,
+                "The legnth of time that it's taken to handle individual requests");
+
+        addStat("OpenConnectionCount", openConnectionCount);
+        addStat("ConnectionRequestCount", connectionRequestCount);
+        addStat("ConnectionDuration", connectionDuration);
+        addStat("TotalErrorCount", totalErrorCount);
+        addStat("TotalRequestCount", totalRequestCount);
+        addStat("ActiveRequestCount", activeRequestCount);
+        addStat("RequestDuration", requestDuration);
+    }
+    public RangeStatistic getOpenConnectionCount() {
+        return openConnectionCount;
+    }
+
+    public RangeStatistic getConnectionRequestCount() {
+        return connectionRequestCount;
+    }
+
+    public TimeStatistic getConnectionDuration() {
+        return connectionDuration;
+    }
+
+    public CountStatistic getTotalErrorCount() {
+        return totalErrorCount;
+    }
+
+    public CountStatistic getTotalRequestCount() {
+        return totalRequestCount;
+    }
+
+    public RangeStatistic getActiveRequestCount() {
+        return activeRequestCount;
+    }
+
+    public TimeStatistic getRequestDuration() {
+        return requestDuration;
+    }
+
+    public RangeStatisticImpl getOpenConnectionCountImpl() {
+        return openConnectionCount;
+    }
+
+    public RangeStatisticImpl getConnectionRequestCountImpl() {
+        return connectionRequestCount;
+    }
+
+    public TimeStatisticImpl getConnectionDurationImpl() {
+        return connectionDuration;
+    }
+
+    public CountStatisticImpl getTotalErrorCountImpl() {
+        return totalErrorCount;
+    }
+
+    public CountStatisticImpl getTotalRequestCountImpl() {
+        return totalRequestCount;
+    }
+
+    public RangeStatisticImpl getActiveRequestCountImpl() {
+        return activeRequestCount;
+    }
+
+    public TimeStatisticImpl getRequestDurationImpl() {
+        return requestDuration;
+    }
+}

Added: geronimo/trunk/modules/management/src/java/org/apache/geronimo/management/geronimo/stats/WebContainerStats.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/management/src/java/org/apache/geronimo/management/geronimo/stats/WebContainerStats.java?rev=329565&view=auto
==============================================================================
--- geronimo/trunk/modules/management/src/java/org/apache/geronimo/management/geronimo/stats/WebContainerStats.java (added)
+++ geronimo/trunk/modules/management/src/java/org/apache/geronimo/management/geronimo/stats/WebContainerStats.java Sun Oct 30 05:47:59 2005
@@ -0,0 +1,73 @@
+/**
+ * Copyright 2005 The Apache Software Foundation
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.apache.geronimo.management.geronimo.stats;
+
+import javax.management.j2ee.statistics.Stats;
+import javax.management.j2ee.statistics.RangeStatistic;
+import javax.management.j2ee.statistics.TimeStatistic;
+import javax.management.j2ee.statistics.CountStatistic;
+
+/**
+ * Statistics exposed by a web container (for the container as a whole, not
+ * a particular servlet/JSP/URL).
+ *
+ * todo: confirm the definitions of the Jetty stats included here; verify these are valid for Tomcat as well
+ *
+ * @version $Revision: 1.0$
+ */
+public interface WebContainerStats extends Stats {
+    /**
+     * Gets the number of connections currently open (as well as the min and
+     * max since statistics gathering started).
+     */
+    RangeStatistic getOpenConnectionCount();
+
+    /**
+     * Gets the number of requests handled by a particular connection (as well
+     * as the min and max since statistics gathering started).
+     */
+    RangeStatistic getConnectionRequestCount();
+
+    /**
+     * Gets the legnth of time that connections have been open (includes
+     * figures across all connections open at present)
+     */
+    TimeStatistic getConnectionDuration();
+
+    /**
+     * Gets the number of errors that have been returned since statistics
+     * gathering started.
+     */
+    CountStatistic getTotalErrorCount();
+
+    /**
+     * Gets the number of requests that have been processed since statistics
+     * gathering started.
+     */
+    CountStatistic getTotalRequestCount();
+
+    /**
+     * Gets the number of requests being processed concurrently (as well
+     * as the min and max since statistics gathering started).
+     */
+    RangeStatistic getActiveRequestCount();
+
+    /**
+     * Gets the legnth of time taken to process a request (includes
+     * figures across all requests since statistics gathering started)
+     */
+    TimeStatistic getRequestDuration();
+}

Modified: geronimo/trunk/modules/management/src/java/org/apache/geronimo/management/stats/StatisticImpl.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/management/src/java/org/apache/geronimo/management/stats/StatisticImpl.java?rev=329565&r1=329564&r2=329565&view=diff
==============================================================================
--- geronimo/trunk/modules/management/src/java/org/apache/geronimo/management/stats/StatisticImpl.java (original)
+++ geronimo/trunk/modules/management/src/java/org/apache/geronimo/management/stats/StatisticImpl.java Sun Oct 30 05:47:59 2005
@@ -33,10 +33,11 @@
     public final static String UNIT_TIME_MICROSECOND = "MICROSECOND";
     public final static String UNIT_TIME_NANOSECOND = "NANOSECOND";
     // Units that are not defined in JSR-77
-    public final static String UNIT_MEMORY_BYTES = "BYTES";
-    public final static String UNIT_MEMORY_KILOBYTES = "KILOBYTES";
-    public final static String UNIT_MEMORY_MEGABYTES = "MEGABYTES";
-    public final static String UNIT_MEMORY_GIGABYTES = "GIGABYTES";
+    public final static String UNIT_MEMORY_BYTES = "BYTE";
+    public final static String UNIT_MEMORY_KILOBYTES = "KILOBYTE";
+    public final static String UNIT_MEMORY_MEGABYTES = "MEGABYTE";
+    public final static String UNIT_MEMORY_GIGABYTES = "GIGABYTE";
+    public final static String UNIT_COUNT = "COUNT";
 
     private String name;
     private String unit;