You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by jb...@apache.org on 2007/09/28 15:48:00 UTC

svn commit: r580352 - in /geronimo/server/trunk: applications/console/geronimo-console-standard/src/main/java/org/apache/geronimo/console/util/ applications/console/geronimo-console-standard/src/main/java/org/apache/geronimo/console/webmanager/ applica...

Author: jbohn
Date: Fri Sep 28 06:47:57 2007
New Revision: 580352

URL: http://svn.apache.org/viewvc?rev=580352&view=rev
Log:
GERONIMO-2775 Get Jetty Stats portlet working again.  Merge of 580137 from branches/2.0

Added:
    geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/java/org/apache/geronimo/console/util/TimeUtils.java
      - copied unchanged from r580137, geronimo/server/branches/2.0/applications/console/geronimo-console-standard/src/main/java/org/apache/geronimo/console/util/TimeUtils.java
Removed:
    geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/java/org/apache/geronimo/console/webmanager/StatisticsHelper.java
Modified:
    geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/java/org/apache/geronimo/console/webmanager/WebManagerPortlet.java
    geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/webapp/WEB-INF/view/webmanager/normal.jsp
    geronimo/server/trunk/modules/geronimo-jetty6/src/main/java/org/apache/geronimo/jetty6/JettyContainer.java
    geronimo/server/trunk/modules/geronimo-jetty6/src/main/java/org/apache/geronimo/jetty6/JettyContainerImpl.java
    geronimo/server/trunk/modules/geronimo-jetty6/src/main/java/org/apache/geronimo/jetty6/JettyWebContainerStatsImpl.java
    geronimo/server/trunk/modules/geronimo-management/src/main/java/org/apache/geronimo/management/geronimo/stats/WebContainerStats.java

Modified: geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/java/org/apache/geronimo/console/webmanager/WebManagerPortlet.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/java/org/apache/geronimo/console/webmanager/WebManagerPortlet.java?rev=580352&r1=580351&r2=580352&view=diff
==============================================================================
--- geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/java/org/apache/geronimo/console/webmanager/WebManagerPortlet.java (original)
+++ geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/java/org/apache/geronimo/console/webmanager/WebManagerPortlet.java Fri Sep 28 06:47:57 2007
@@ -19,6 +19,7 @@
 
 import org.apache.geronimo.console.BasePortlet;
 import org.apache.geronimo.console.util.PortletManager;
+import org.apache.geronimo.console.util.TimeUtils;
 import org.apache.geronimo.management.geronimo.WebContainer;
 import org.apache.geronimo.management.geronimo.WebManager;
 import org.apache.geronimo.management.geronimo.stats.WebContainerStats;
@@ -60,11 +61,10 @@
                 if (containers != null) {
                     WebContainer container = containers[0];  //todo: handle multiple
                     String server = getWebServerType(container.getClass());
-                    String action = actionRequest.getParameter("stats");
-                    if (action != null) {
-                        boolean stats = action.equals("true");
+                    if (actionRequest.getParameter("stats") != null) {
+                        Boolean stats = actionRequest.getParameter("stats").equals("true") ? Boolean.TRUE : Boolean.FALSE;
                         if(server.equals(WEB_SERVER_JETTY)) {
-                            setProperty(container, "collectStatistics", stats ? Boolean.TRUE : Boolean.FALSE);
+                            setProperty(container, "collectStatistics", stats);
                         }
                         else if (server.equals(WEB_SERVER_TOMCAT)) {
                             //todo:   Any Tomcat specific processing?
@@ -75,7 +75,7 @@
                     }
                     if (actionRequest.getParameter("resetStats") != null) {
                         if(server.equals(WEB_SERVER_JETTY)) {
-                            callOperation(container, "resetStatistics", null);
+                            callOperation(container, "resetStats", null);
                         }
                         else if (server.equals(WEB_SERVER_TOMCAT)) {
                             //todo:   Any Tomcat specific processing?
@@ -114,28 +114,19 @@
                         if (webStats.isStatsOn()) {
                             renderRequest.setAttribute("statsOn", Boolean.TRUE);
                             renderRequest.setAttribute("totalRequestCount", new Long(webStats.getTotalRequestCount().getCount()));
-                            renderRequest.setAttribute("totalConnectionCount", new Long(webStats.getTotalConnectionCount().getCount()));
-                            renderRequest.setAttribute("totalErrorCount", new Long(webStats.getTotalErrorCount().getCount()));
                             renderRequest.setAttribute("activeRequestCountCurrent", new Long(webStats.getActiveRequestCount().getCurrent()));
                             renderRequest.setAttribute("activeRequestCountLow", new Long(webStats.getActiveRequestCount().getLowWaterMark()));
                             renderRequest.setAttribute("activeRequestCountHigh", new Long(webStats.getActiveRequestCount().getHighWaterMark()));
-                            renderRequest.setAttribute("connectionRequestCountCurrent", new Long(webStats.getConnectionRequestCount().getCurrent()));
-                            renderRequest.setAttribute("connectionRequestCountLow", new Long(webStats.getConnectionRequestCount().getLowWaterMark()));
-                            renderRequest.setAttribute("connectionRequestCountHigh", new Long(webStats.getConnectionRequestCount().getHighWaterMark()));
-    //                          renderRequest.setAttribute("connectionRequestsAve", new Long(0));   /* Can't really compute this for a range ... do we still need it (from old portlet) */
-                            renderRequest.setAttribute("openConnectionCountCurrent", new Long(webStats.getOpenConnectionCount().getCurrent()));
-                            renderRequest.setAttribute("openConnectionCountLow", new Long(webStats.getOpenConnectionCount().getLowWaterMark()));
-                            renderRequest.setAttribute("openConnectionCountHigh", new Long(webStats.getOpenConnectionCount().getHighWaterMark()));
-                            renderRequest.setAttribute("requestDurationCount", new Long(webStats.getRequestDuration().getCount()));
+                            renderRequest.setAttribute("requestDurationAvg", new Long(webStats.getRequestDurationAvg().getCount()));
                             renderRequest.setAttribute("requestDurationMinTime", new Long(webStats.getRequestDuration().getMinTime()));
                             renderRequest.setAttribute("requestDurationMaxTime", new Long(webStats.getRequestDuration().getMaxTime()));
                             renderRequest.setAttribute("requestDurationTotalTime", new Long(webStats.getRequestDuration().getTotalTime()));
-    //                          renderRequest.setAttribute("requestDurationAve", new Long(0));  /* Would this be valuable to calculate?  We used to show this in the old jetty only portlet */
-                            renderRequest.setAttribute("connectionDurationCount", new Long(webStats.getConnectionDuration().getCount()));
-                            renderRequest.setAttribute("connectionDurationMinTime", new Long(webStats.getConnectionDuration().getMinTime()));
-                            renderRequest.setAttribute("connectionDurationMaxTime", new Long(webStats.getConnectionDuration().getMaxTime()));
-                            renderRequest.setAttribute("connectionDurationTotalTime", new Long(webStats.getConnectionDuration().getTotalTime()));
-    //                          renderRequest.setAttribute("connectionDurationAve", new Long(0));   /* Wouldl this be valueable to calculate?  We used to show this in the old jetty only portlet */
+                            renderRequest.setAttribute("response1xx", new Long(webStats.getResponses1xx().getCount()));
+                            renderRequest.setAttribute("response2xx", new Long(webStats.getResponses2xx().getCount()));
+                            renderRequest.setAttribute("response3xx", new Long(webStats.getResponses3xx().getCount()));
+                            renderRequest.setAttribute("response4xx", new Long(webStats.getResponses4xx().getCount()));
+                            renderRequest.setAttribute("response5xx", new Long(webStats.getResponses5xx().getCount()));
+                            renderRequest.setAttribute("elapsedTime", TimeUtils.formatDuration(webStats.getStatsOnMs().getCount()));
                         } else {
                             renderRequest.setAttribute("statsSupported", Boolean.TRUE);
                             renderRequest.setAttribute("statsMessage", "Statistics are not currently being collected.");

Modified: geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/webapp/WEB-INF/view/webmanager/normal.jsp
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/webapp/WEB-INF/view/webmanager/normal.jsp?rev=580352&r1=580351&r2=580352&view=diff
==============================================================================
--- geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/webapp/WEB-INF/view/webmanager/normal.jsp (original)
+++ geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/webapp/WEB-INF/view/webmanager/normal.jsp Fri Sep 28 06:47:57 2007
@@ -21,19 +21,31 @@
 <table width="100%">
   <tr>
     <th width="25%" class="DarkBackground"><STRONG>Statistic</STRONG></th>
-    <th class="DarkBackground"><strong>Total</strong></th>
+    <th class="DarkBackground"><strong>Count</strong></th>
   </tr>
   <tr>
     <td align="right"  class="LightBackground"><strong>Total Request Count</strong></td>
     <td align="center" class="LightBackground">${totalRequestCount}</td>
   </tr>
   <tr>
-    <td align="right"  class="MediumBackground"><strong>Total Connection Count</strong></td>
-    <td align="center" class="MediumBackground">${totalConnectionCount}</td>
+    <td align="right"  class="MediumBackground"><strong>Total 1xx Responses</strong></td>
+    <td align="center" class="MediumBackground">${response1xx}</td>
+  </tr>
+  <tr>
+    <td align="right"  class="LightBackground"><strong>Total 2xx Responses</strong></td>
+    <td align="center" class="LightBackground">${response2xx}</td>
+  </tr>
+  <tr>
+    <td align="right"  class="MediumBackground"><strong>Total 3xx Responses</strong></td>
+    <td align="center" class="MediumBackground">${response3xx}</td>
+  </tr>
+  <tr>
+    <td align="right"  class="LightBackground"><strong>Total 4xx Responses</strong></td>
+    <td align="center" class="LightBackground">${response4xx}</td>
   </tr>
   <tr>
-    <td align="right"  class="LightBackground"><strong>Total Error Count</strong></td>
-    <td align="center" class="LightBackground">${totalErrorCount}</td>
+    <td align="right"  class="MediumBackground"><strong>Total 5xx Responses</strong></td>
+    <td align="center" class="MediumBackground">${response5xx}</td>
   </tr>
 </table>
 <table width="100%">
@@ -49,47 +61,38 @@
     <td align="center" class="LightBackground">${activeRequestCountLow}</td>
     <td align="center" class="LightBackground">${activeRequestCountHigh}</td>
   </tr>
-  <tr>
-    <td align="right"  class="MediumBackground"><strong>Connection Request Count</strong></td>
-     <td align="center" class="MediumBackground">${connectionRequestCountCurrent}</td>
-     <td align="center" class="MediumBackground">${connectionRequestCountLow}</td>
-    <td align="center" class="MediumBackground">${connectionRequestCountHigh}</td>
-  </tr>
-  <tr>
-    <td align="right"  class="LightBackground"><strong>Open Connection Count</strong></td>
-    <td align="center" class="LightBackground">${openConnectionCountCurrent}</td>
-    <td align="center" class="LightBackground">${openConnectionCountLow}</td>
-    <td align="center" class="LightBackground">${openConnectionCountHigh}</td>
-  </tr>
 </table>
 <table width="100%">
   <tr>
     <th width="25%" class="DarkBackground"> &nbsp; </th>
-    <th class="DarkBackground"><strong>Count</strong></th>
-    <th class="DarkBackground"><strong>Min Time</strong></th>
-    <th class="DarkBackground"><strong>Max Time</strong></th>
-    <th class="DarkBackground"><strong>Total Time</strong></th>
+    <th class="DarkBackground"><strong>Avg Time (ms) </strong></th>
+    <th class="DarkBackground"><strong>Min Time (ms)</strong></th>
+    <th class="DarkBackground"><strong>Max Time (ms)</strong></th>
+    <th class="DarkBackground"><strong>Total Time (ms)</strong></th>
   </tr>
   <tr>
     <td align="right"  class="LightBackground"><strong>Request Duration</strong></td>
-    <td align="center" class="LightBackground">${requestDurationCount}</td>
+    <td align="center" class="LightBackground">${requestDurationAvg}</td>
     <td align="center" class="LightBackground">${requestDurationMinTime}</td>
     <td align="center" class="LightBackground">${requestDurationMaxTime}</td>
     <td align="center" class="LightBackground">${requestDurationTotalTime}</td>
   </tr>
+  <tr><td colspan="5" align="left">&nbsp;</td></tr>
+  <tr>
+    <td colspan="5" align="left"><strong>Elapsed Time Since Collection Started (hh:mm:ss:SSS):</strong>&nbsp;${elapsedTime}</td>
+  </tr>
+  <tr><td colspan="5" align="left">&nbsp;</td></tr>
   <tr>
-    <td align="right"  class="MediumBackground"><strong>Connection Duration</strong></td>
-    <td align="center" class="MediumBackground">${connectionDurationCount}</td>
-    <td align="center" class="MediumBackground">${connectionDurationMinTime}</td>
-    <td align="center" class="MediumBackground">${connectionDurationMaxTime}</td>
-    <td align="center" class="MediumBackground">${connectionDurationTotalTime}</td>
+    <td colspan="5" align="left"> 
+      <a href="<portlet:actionURL><portlet:param name="stats" value="false"/></portlet:actionURL>">disable</a>&nbsp; 
+      <a href="<portlet:renderURL/>">refresh</a>&nbsp; 
+      <a href="<portlet:actionURL><portlet:param name="resetStats" value="true"/></portlet:actionURL>">reset</a> 
+    </td>
   </tr>
-  <tr><td colspan="5" align="left">&nbsp;&nbsp;</td></tr>
-  <tr><td colspan="5" align="left"> <a href="<portlet:renderURL/>">refresh</a>&nbsp; <a href="<portlet:actionURL><portlet:param name="stats" value="false"/></portlet:actionURL>">disable</a>&nbsp; <a href="<portlet:actionURL><portlet:param name="resetStats" value="true"/></portlet:actionURL>">reset</a> </td></tr>
 </table>
 </c:if>
 <c:if test="${!statsOn}">
-  ${statsMessage}<br/>
+  ${statsMessage}<br/><br/>
   <c:if test="${statsSupported}">
     <a href="<portlet:actionURL><portlet:param name="stats" value="true"/></portlet:actionURL>">enable</a>
   </c:if>

Modified: geronimo/server/trunk/modules/geronimo-jetty6/src/main/java/org/apache/geronimo/jetty6/JettyContainer.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-jetty6/src/main/java/org/apache/geronimo/jetty6/JettyContainer.java?rev=580352&r1=580351&r2=580352&view=diff
==============================================================================
--- geronimo/server/trunk/modules/geronimo-jetty6/src/main/java/org/apache/geronimo/jetty6/JettyContainer.java (original)
+++ geronimo/server/trunk/modules/geronimo-jetty6/src/main/java/org/apache/geronimo/jetty6/JettyContainer.java Fri Sep 28 06:47:57 2007
@@ -40,7 +40,7 @@
 
     void removeRealm(String realmName);
 
-    void resetStatistics();
+    void resetStats();
 
     void setCollectStatistics(boolean on);
 

Modified: geronimo/server/trunk/modules/geronimo-jetty6/src/main/java/org/apache/geronimo/jetty6/JettyContainerImpl.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-jetty6/src/main/java/org/apache/geronimo/jetty6/JettyContainerImpl.java?rev=580352&r1=580351&r2=580352&view=diff
==============================================================================
--- geronimo/server/trunk/modules/geronimo-jetty6/src/main/java/org/apache/geronimo/jetty6/JettyContainerImpl.java (original)
+++ geronimo/server/trunk/modules/geronimo-jetty6/src/main/java/org/apache/geronimo/jetty6/JettyContainerImpl.java Fri Sep 28 06:47:57 2007
@@ -41,6 +41,7 @@
 import org.mortbay.jetty.handler.DefaultHandler;
 import org.mortbay.jetty.handler.HandlerCollection;
 import org.mortbay.jetty.handler.RequestLogHandler;
+import org.mortbay.jetty.handler.StatisticsHandler;
 import org.mortbay.jetty.handler.AbstractHandlerContainer;
 
 /**
@@ -61,6 +62,8 @@
     private File jettyHomeDir;
     private JettyWebContainerStatsImpl stats;
     private final Map realms = new HashMap();
+    // list of handlers
+    private StatisticsHandler statsHandler = new StatisticsHandler();  
     private HandlerCollection handlerCollection = new HandlerCollection();
     private ContextHandlerCollection contextHandlerCollection = new ContextHandlerCollection();
     private DefaultHandler defaultHandler = new DefaultHandler();
@@ -90,6 +93,9 @@
         handlers[2] = requestLogHandler;
         handlerCollection.setHandlers(handlers);
         server.setHandler(handlerCollection);
+        handlerCollection.addHandler(statsHandler);
+
+        statsHandler.setServer(server);
 
         stats = new JettyWebContainerStatsImpl();
         this.manager = manager;
@@ -119,70 +125,61 @@
         return manager.getConnectorsForContainer(this, protocol);
     }
 
-    public void resetStatistics() {
-        //TODO: for jetty6
+    public void resetStats() {
+        statsHandler.statsReset();
     }
 
     public void setCollectStatistics(boolean on) {
-        //TODO: for jetty6
+        try {
+            if(on) {
+                 statsHandler.start();
+            } else {
+                 statsHandler.stop();
+            }
+            stats.setStatsOn(on);
+            statsHandler.statsReset();
+        } catch(Exception e) {
+            e.printStackTrace();
+        }
     }
 
     public boolean getCollectStatistics() {
-        //TODO: for jetty6
-        return false;
+        return statsHandler.isRunning();
     }
 
     public long getCollectStatisticsStarted() {
-        //TODO: for jetty6
-        return 0L;
-    }
-
-    public void resetStats() {
-        // TODO 
+        return statsHandler.getStatsOnMs();
     }
 
     public Stats getStats() {
         if (getCollectStatistics()) {
 
             /* set active request count */
-//            stats.getTotalRequestCountImpl().setCount(server.getRequests());
-
-            /* set total connection count */
-//            stats.getTotalConnectionCountImpl().setCount(server.getConnections());
-
-            /* set total error count */
-//            stats.getTotalErrorCountImpl().setCount(server.getErrors());
+            stats.getTotalRequestCountImpl().setCount((long)statsHandler.getRequests());
 
             /* set active request range values */
-//            stats.getActiveRequestCountImpl().setCurrent(server.getRequestsActive());
-//            stats.getActiveRequestCountImpl().setLowWaterMark(server.getRequestsActiveMin());
-//            stats.getActiveRequestCountImpl().setHighWaterMark(server.getRequestsActiveMax());
-
-            /* set connection requests range values */
-//          stats.getConnectionRequestCountImpl().setCurrent(server.getConnectionsRequestsCurrent());    // temporarily removed until added by jetty6
-//            stats.getConnectionRequestCountImpl().setCurrent(server.getConnectionsOpen());
-//            stats.getConnectionRequestCountImpl().setLowWaterMark(server.getConnectionsRequestsMin());
-//            stats.getConnectionRequestCountImpl().setHighWaterMark(server.getConnectionsRequestsMax());
-
-            /* set open connection range values */
-//            stats.getOpenConnectionCountImpl().setCurrent(server.getConnectionsOpen());
-//            stats.getOpenConnectionCountImpl().setLowWaterMark(server.getConnectionsOpenMin());
-//            stats.getOpenConnectionCountImpl().setHighWaterMark(server.getConnectionsOpenMax());
+            stats.getActiveRequestCountImpl().setCurrent((long)statsHandler.getRequestsActive());
+            stats.getActiveRequestCountImpl().setLowWaterMark((long)statsHandler.getRequestsActiveMin());
+            stats.getActiveRequestCountImpl().setHighWaterMark((long)statsHandler.getRequestsActiveMax());
+
+            /* set request duration average time */
+            stats.getRequestDurationAvgImpl().setCount((long)statsHandler.getRequestsDurationAve());     // Normally this would be calculated
 
             /* set request duration time values */
-//            stats.getRequestDurationImpl().setMinTime(server.getRequestsDurationMin());
-//            stats.getRequestDurationImpl().setMaxTime(server.getRequestsDurationMax());
-//          stats.getRequestDurationImpl().setCount(server.getRequestsDurationCount());     // temporarily removed until added by jetty6
-            stats.getRequestDurationImpl().setCount(stats.getTotalRequestCount().getCount());
-//            stats.getRequestDurationImpl().setTotalTime(server.getRequestsDurationTotal());
-
-            /* set connection duration Time values */
-//            stats.getConnectionDurationImpl().setMinTime(server.getConnectionsDurationMin());
-//            stats.getConnectionDurationImpl().setMaxTime(server.getConnectionsDurationMax());
-//          stats.getConnectionDurationImpl().setCount(server.getConnectionsDurationCount());    // temporarily removed until added by jetty6
-            stats.getConnectionDurationImpl().setCount(stats.getTotalConnectionCount().getCount());
-//            stats.getConnectionDurationImpl().setTotalTime(server.getConnectionsDurationTotal());
+//            stats.getRequestDurationImpl().setCount((long)statsHandler.getRequestsDurationCount());    Not yet supported by Jetty
+            stats.getRequestDurationImpl().setMaxTime((long)statsHandler.getRequestsDurationMax());
+            stats.getRequestDurationImpl().setMinTime((long)statsHandler.getRequestsDurationMin());
+            stats.getRequestDurationImpl().setTotalTime((long)statsHandler.getRequestsDurationTotal());
+
+            /* set request count values*/
+            stats.getResponses1xxImpl().setCount((long)statsHandler.getResponses1xx());
+            stats.getResponses2xxImpl().setCount((long)statsHandler.getResponses2xx());
+            stats.getResponses3xxImpl().setCount((long)statsHandler.getResponses3xx());
+            stats.getResponses4xxImpl().setCount((long)statsHandler.getResponses4xx());
+            stats.getResponses5xxImpl().setCount((long)statsHandler.getResponses5xx());
 
+            /* set elapsed time for stats collection */
+            stats.getStatsOnMsImpl().setCount((long)statsHandler.getStatsOnMs());
         } else {
             // should probably set the stats object to all zero/null values to avoid unpredicable results
         }
@@ -257,7 +254,7 @@
         }
         return new File(jettyHomeDir, workDir);
     }
-    /* ------------------------------------------------------------ */
+
     public RequestLog getRequestLog() {
         return this.requestLogHandler.getRequestLog();
     }
@@ -289,18 +286,9 @@
 
     static {
         GBeanInfoBuilder infoBuilder = GBeanInfoBuilder.createStatic("Jetty Web Container", JettyContainerImpl.class);
-//        infoBuilder.addAttribute("collectStatistics", Boolean.TYPE, true);
-//        infoBuilder.addAttribute("collectStatisticsStarted", Long.TYPE, false);
-//        infoBuilder.addOperation("resetStatistics");
-
-//        infoBuilder.addAttribute("requestLog", RequestLog.class, false, false);
-
-//        infoBuilder.addOperation("addListener", new Class[]{Connector.class});
-//        infoBuilder.addOperation("removeListener", new Class[]{Connector.class});
-//        infoBuilder.addOperation("addContext", new Class[]{ContextHandler.class});
-//        infoBuilder.addOperation("removeContext", new Class[]{ContextHandler.class});
-//        infoBuilder.addOperation("addRealm", new Class[]{String.class});
-//        infoBuilder.addOperation("removeRealm", new Class[]{String.class});
+        infoBuilder.addAttribute("collectStatistics", Boolean.TYPE, true);
+        infoBuilder.addAttribute("collectStatisticsStarted", Long.TYPE, false);
+        infoBuilder.addOperation("resetStats");
 
         infoBuilder.addAttribute("objectName", String.class, false);
         infoBuilder.addReference("WebManager", WebManager.class);
@@ -319,5 +307,6 @@
     public static GBeanInfo getGBeanInfo() {
         return GBEAN_INFO;
     }
+
 
 }

Modified: geronimo/server/trunk/modules/geronimo-jetty6/src/main/java/org/apache/geronimo/jetty6/JettyWebContainerStatsImpl.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-jetty6/src/main/java/org/apache/geronimo/jetty6/JettyWebContainerStatsImpl.java?rev=580352&r1=580351&r2=580352&view=diff
==============================================================================
--- geronimo/server/trunk/modules/geronimo-jetty6/src/main/java/org/apache/geronimo/jetty6/JettyWebContainerStatsImpl.java (original)
+++ geronimo/server/trunk/modules/geronimo-jetty6/src/main/java/org/apache/geronimo/jetty6/JettyWebContainerStatsImpl.java Fri Sep 28 06:47:57 2007
@@ -32,63 +32,66 @@
  * @version $Revision: 1.0$
  */
 public class JettyWebContainerStatsImpl extends StatsImpl implements JettyWebContainerStats {
-    private CountStatisticImpl totalConnectionCount;
-    private RangeStatisticImpl openConnectionCount;
-    private RangeStatisticImpl connectionRequestCount;
-    private TimeStatisticImpl connectionDuration;
-    private CountStatisticImpl totalErrorCount;
     private CountStatisticImpl totalRequestCount;
     private RangeStatisticImpl activeRequestCount;
     private TimeStatisticImpl requestDuration;
+    private CountStatisticImpl requestDurationAvg;
+    private CountStatisticImpl response1xx;
+    private CountStatisticImpl response2xx;
+    private CountStatisticImpl response3xx;
+    private CountStatisticImpl response4xx;
+    private CountStatisticImpl response5xx;
+    private TimeStatisticImpl statsOnMs;               // time elapsed since the stats collection
+
     private boolean statsOn=false;
 
     public JettyWebContainerStatsImpl() {
-        totalConnectionCount = new CountStatisticImpl("Total Connections", StatisticImpl.UNIT_COUNT,
-                "The total number of connections since last reset");
-        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 length of time that it's taken to handle individual requests");
+        requestDurationAvg = new CountStatisticImpl("Request Duration Average", StatisticImpl.UNIT_COUNT,
+                "The average length of time that it's taken to handle individual requests");
+        response1xx = new CountStatisticImpl("Response 1xx", StatisticImpl.UNIT_COUNT,
+                "The number of 1xx responses");
+        response2xx = new CountStatisticImpl("Response 2xx", StatisticImpl.UNIT_COUNT,
+                "The number of 2xx responses");
+        response3xx = new CountStatisticImpl("Response 3xx", StatisticImpl.UNIT_COUNT,
+                "The number of 3xx responses");
+        response4xx = new CountStatisticImpl("Response 4xx", StatisticImpl.UNIT_COUNT,
+                "The number of 4xx responses");
+        response5xx = new CountStatisticImpl("Response 5xx", StatisticImpl.UNIT_COUNT,
+                "The number of 5xx responses");
+        statsOnMs = new TimeStatisticImpl("Stats Duration", StatisticImpl.UNIT_TIME_MILLISECOND,
+                "The length of time that statistics have been collected.");
 
-        addStat("TotalConnectionCount", totalConnectionCount);
-        addStat("OpenConnectionCount", openConnectionCount);
-        addStat("ConnectionRequestCount", connectionRequestCount);
-        addStat("ConnectionDuration", connectionDuration);
-        addStat("TotalErrorCount", totalErrorCount);
         addStat("TotalRequestCount", totalRequestCount);
         addStat("ActiveRequestCount", activeRequestCount);
         addStat("RequestDuration", requestDuration);
+        addStat("RequestDurationAvg", requestDurationAvg);
+        addStat("Response1xx", response1xx);
+        addStat("Response2xx", response2xx);
+        addStat("Response3xx", response3xx);
+        addStat("Response4xx", response4xx);
+        addStat("Response5xx", response5xx);
+        addStat("StatsDuration", statsOnMs);
     }
 
-    public CountStatistic getTotalConnectionCount() {
-        return totalConnectionCount;
-    }
-
-    public RangeStatistic getOpenConnectionCount() {
-        return openConnectionCount;
-    }
-
-    public RangeStatistic getConnectionRequestCount() {
-        return connectionRequestCount;
+    public boolean isStatsOn() {
+        return statsOn;
     }
 
-    public TimeStatistic getConnectionDuration() {
-        return connectionDuration;
+    public void setStatsOn(boolean on) {
+        statsOn = on;
     }
 
-    public CountStatistic getTotalErrorCount() {
-        return totalErrorCount;
-    }
+/**
+ * Public methods to return the interfaces for statistics.
+ * These are used by the objets (such as the web console) that
+ * retreive the stats for presentation purposes.
+ */
 
     public CountStatistic getTotalRequestCount() {
         return totalRequestCount;
@@ -102,33 +105,61 @@
         return requestDuration;
     }
 
-    public boolean isStatsOn() {
-        return statsOn;
+    public CountStatistic getRequestDurationAvg() {
+        return requestDurationAvg;
     }
 
-    public void setStatsOn(boolean on) {
-        statsOn = on;
-    }
-
-    public CountStatisticImpl getTotalConnectionCountImpl() {
-        return totalConnectionCount;
-    }
-
-    public RangeStatisticImpl getOpenConnectionCountImpl() {
-        return openConnectionCount;
-    }
-
-    public RangeStatisticImpl getConnectionRequestCountImpl() {
-        return connectionRequestCount;
-    }
-
-    public TimeStatisticImpl getConnectionDurationImpl() {
-        return connectionDuration;
-    }
-
-    public CountStatisticImpl getTotalErrorCountImpl() {
-        return totalErrorCount;
-    }
+    /**
+     * @return Gets the number of 1xx status returned by this
+     * context since last call of stats reset.
+     */
+    public CountStatistic getResponses1xx() {
+        return response1xx;
+    }
+
+    /**
+     * @return Gets the number of 2xx status returned by this
+     * context since last call of stats reset.
+     */
+    public CountStatistic getResponses2xx() {
+        return response2xx;
+    }
+    
+    /**
+     * @return Gets the number of 3xx status returned by this
+     * context since last call of stats reset.
+     */
+    public CountStatistic getResponses3xx() {
+        return response3xx;
+    }
+    
+    /**
+     * @return Gets the number of 4xx status returned by this
+     * context since last call of stats reset.
+     */
+    public CountStatistic getResponses4xx() {
+        return response4xx;
+    }
+    
+    /**
+     * @return Gets the number of 5xx status returned by this
+     * context since last call of stats reset.
+     */
+    public CountStatistic getResponses5xx() {
+        return response5xx;
+    }
+    
+    /**
+     * @return Time in millis since statistics collection was started.
+     */
+    public TimeStatistic getStatsOnMs() {
+        return statsOnMs;
+    }
+
+/**
+ * Public methods to return the implementations for statistics.
+ * These are used by the JettyContainerImpl to set the values.
+ */
 
     public CountStatisticImpl getTotalRequestCountImpl() {
         return totalRequestCount;
@@ -140,5 +171,56 @@
 
     public TimeStatisticImpl getRequestDurationImpl() {
         return requestDuration;
+    }
+
+    public CountStatisticImpl getRequestDurationAvgImpl() {
+        return requestDurationAvg;
+    }
+
+    /**
+     * @return Gets the number of 1xx status returned by this
+     * context since last call of stats reset.
+     */
+    public CountStatisticImpl getResponses1xxImpl() {
+        return response1xx;
+    }
+
+    /**
+     * @return Gets the number of 2xx status returned by this
+     * context since last call of stats reset.
+     */
+    public CountStatisticImpl getResponses2xxImpl() {
+        return response2xx;
+    }
+    
+    /**
+     * @return Gets the number of 3xx status returned by this
+     * context since last call of stats reset.
+     */
+    public CountStatisticImpl getResponses3xxImpl() {
+        return response3xx;
+    }
+    
+    /**
+     * @return Gets the number of 4xx status returned by this
+     * context since last call of stats reset.
+     */
+    public CountStatisticImpl getResponses4xxImpl() {
+        return response4xx;
+    }
+    
+    /**
+     * @return Gets the number of 5xx status returned by this
+     * context since last call of stats reset.
+     */
+    public CountStatisticImpl getResponses5xxImpl() {
+        return response5xx;
+    }
+    
+    /**
+     * @return Time in millis since statistics collection was started.
+     */
+    public TimeStatisticImpl getStatsOnMsImpl() {
+        return statsOnMs;
     }
 }

Modified: geronimo/server/trunk/modules/geronimo-management/src/main/java/org/apache/geronimo/management/geronimo/stats/WebContainerStats.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-management/src/main/java/org/apache/geronimo/management/geronimo/stats/WebContainerStats.java?rev=580352&r1=580351&r2=580352&view=diff
==============================================================================
--- geronimo/server/trunk/modules/geronimo-management/src/main/java/org/apache/geronimo/management/geronimo/stats/WebContainerStats.java (original)
+++ geronimo/server/trunk/modules/geronimo-management/src/main/java/org/apache/geronimo/management/geronimo/stats/WebContainerStats.java Fri Sep 28 06:47:57 2007
@@ -30,55 +30,63 @@
  * @version $Revision: 1.0$
  */
 public interface WebContainerStats extends Stats {
+
     /**
-     * Gets the total number of connections thus far
+     * Gets the number of requests that have been processed since statistics
+     * gathering started.
      */
-    CountStatistic getTotalConnectionCount();
- 
+    CountStatistic getTotalRequestCount();
+
     /**
-     * Gets the number of connections currently open (as well as the min and
-     * max since statistics gathering started).
+     * Gets the number of requests being processed concurrently (as well
+     * as the min and max since statistics gathering started).
      */
-    RangeStatistic getOpenConnectionCount();
+    RangeStatistic getActiveRequestCount();
 
     /**
-     * Gets the number of requests handled by a particular connection (as well
-     * as the min and max since statistics gathering started).
+     * Gets the length of time taken to process a request (includes
+     * figures across all requests since statistics gathering started)
      */
-    RangeStatistic getConnectionRequestCount();
+    TimeStatistic getRequestDuration();
 
     /**
-     * Gets the legnth of time that connections have been open (includes
-     * figures across all connections open at present)
+     * Gets the average time to process a request
      */
-    TimeStatistic getConnectionDuration();
+    CountStatistic getRequestDurationAvg();
 
     /**
-     * Gets the number of errors that have been returned since statistics
-     * gathering started.
+     * Gets the count of 1xx responses
      */
-    CountStatistic getTotalErrorCount();
+    CountStatistic getResponses1xx();
 
     /**
-     * Gets the number of requests that have been processed since statistics
-     * gathering started.
+     * Gets the count of 2xx responses
      */
-    CountStatistic getTotalRequestCount();
+    CountStatistic getResponses2xx();
 
     /**
-     * Gets the number of requests being processed concurrently (as well
-     * as the min and max since statistics gathering started).
+     * Gets the count of 3xx responses
      */
-    RangeStatistic getActiveRequestCount();
+    CountStatistic getResponses3xx();
 
     /**
-     * Gets the legnth of time taken to process a request (includes
-     * figures across all requests since statistics gathering started)
+     * Gets the count of 4xx responses
      */
-    TimeStatistic getRequestDuration();
+    CountStatistic getResponses4xx();
+
+    /**
+     * Gets the count of 5xx responses
+     */
+    CountStatistic getResponses5xx();
+
+    /**
+     * Gets the time duration that stats have been active.
+     */
+    TimeStatistic getStatsOnMs();
 
     /**
      * Gets the current state of statistics collection (on or off)
      */
     boolean isStatsOn();
+
 }