geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ammul...@apache.org
Subject svn commit: r392680 - in /geronimo/branches/1.1: applications/console-standard/src/java/org/apache/geronimo/console/webmanager/ applications/console-standard/src/webapp/WEB-INF/view/webmanager/ modules/jetty/src/java/org/apache/geronimo/jetty/ modules/...
Date Sun, 09 Apr 2006 05:25:07 GMT
Author: ammulder
Date: Sat Apr  8 22:25:06 2006
New Revision: 392680

URL: http://svn.apache.org/viewcvs?rev=392680&view=rev
Log:
Appled GERONIMO-1130 to 1.1 branch (Jetty web stats implement JSR-77 stats
  interface, etc.)

Added:
    geronimo/branches/1.1/modules/jetty/src/java/org/apache/geronimo/jetty/JettyWebContainerStats.java
  (with props)
Removed:
    geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/webmanager/JettyStatisticsHelper.java
Modified:
    geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/webmanager/WebManagerPortlet.java
    geronimo/branches/1.1/applications/console-standard/src/webapp/WEB-INF/view/webmanager/normal.jsp
    geronimo/branches/1.1/modules/jetty/src/java/org/apache/geronimo/jetty/JettyContainer.java
    geronimo/branches/1.1/modules/jetty/src/java/org/apache/geronimo/jetty/JettyContainerImpl.java
    geronimo/branches/1.1/modules/jetty/src/java/org/apache/geronimo/jetty/JettyWebContainerStatsImpl.java
    geronimo/branches/1.1/modules/management/src/java/org/apache/geronimo/management/geronimo/stats/WebContainerStats.java

Modified: geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/webmanager/WebManagerPortlet.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/webmanager/WebManagerPortlet.java?rev=392680&r1=392679&r2=392680&view=diff
==============================================================================
--- geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/webmanager/WebManagerPortlet.java
(original)
+++ geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/webmanager/WebManagerPortlet.java
Sat Apr  8 22:25:06 2006
@@ -21,6 +21,10 @@
 import org.apache.geronimo.console.util.PortletManager;
 import org.apache.geronimo.management.geronimo.WebContainer;
 import org.apache.geronimo.management.geronimo.WebManager;
+import org.apache.geronimo.management.geronimo.stats.WebContainerStats;
+import org.apache.geronimo.management.StatisticsProvider;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 
 import javax.portlet.ActionRequest;
 import javax.portlet.ActionResponse;
@@ -38,6 +42,8 @@
  * @version $Rev$ $Date$
  */
 public class WebManagerPortlet extends BasePortlet {
+    private final static Log log = LogFactory.getLog(WebManagerPortlet.class);
+
     private PortletRequestDispatcher normalView;
 
     private PortletRequestDispatcher maximizedView;
@@ -64,7 +70,7 @@
                             //todo:   Any Tomcat specific processing?
                         }
                         else {
-                            //todo:   Handle "should not occur" condition
+                            log.error("Unrecognized Web Container");
                         }
                     }
                     if (actionRequest.getParameter("resetStats") != null) {
@@ -75,16 +81,16 @@
                             //todo:   Any Tomcat specific processing?
                         }
                         else {
-                            //todo:   Handle "should not occur" condition
+                            log.error("Unrecognized Web Container");
                         }
                     }
                 }
                 else {
-                    // todo  - Handle "should not occur" error  - message?
+                    log.error("Error attempting to retrieve the web containers");
                 }
             }
             else {
-                // todo  - Handle "should not occur" error  - message?
+                log.error("Error attempting to retrieve the web managers");
             }
         } catch (Exception e) {
             throw new PortletException(e);
@@ -103,27 +109,41 @@
                 WebContainer[] containers = (WebContainer[]) manager.getContainers();
                 if (containers != null) {
                     WebContainer container = containers[0];  //todo: handle multiple
-                    String server = getWebServerType(container.getClass());
-                    StatisticsHelper helper = null;
-                    if(server.equals(WEB_SERVER_JETTY)) {
-                        helper = new JettyStatisticsHelper();
-                    } else if(server.equals(WEB_SERVER_TOMCAT)) {
-                        renderRequest.setAttribute("statsSupported", Boolean.FALSE);
-                        renderRequest.setAttribute("statsMessage", "Statistics are not currently
implemented for this web container.");
-                    }
-                    else {
-                        // todo   - Log error, unknown server
-                    }
-                    if(helper != null) {
-                        helper.gatherStatistics(container, renderRequest);
+                    WebContainerStats webStats = (WebContainerStats) ((StatisticsProvider)container).getStats();
+                    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("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
*/
+                    } else {
+                        renderRequest.setAttribute("statsSupported", Boolean.TRUE);
+                        renderRequest.setAttribute("statsMessage", "Statistics are not currently
being collected.");
                     }
+                } else {
+                    log.error("Error attempting to retrieve the web containers");
                 }
-                else {
-                    // todo  - Handle "should not occur" error  - message?
-                }
-            }
-            else {
-                // todo  - Handle "should not occur" error  - message?
+            } else {
+                log.error("Error attempting to retrieve the web managers");
             }
         } catch (Exception e) {
             throw new PortletException(e);

Modified: geronimo/branches/1.1/applications/console-standard/src/webapp/WEB-INF/view/webmanager/normal.jsp
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/applications/console-standard/src/webapp/WEB-INF/view/webmanager/normal.jsp?rev=392680&r1=392679&r2=392680&view=diff
==============================================================================
--- geronimo/branches/1.1/applications/console-standard/src/webapp/WEB-INF/view/webmanager/normal.jsp
(original)
+++ geronimo/branches/1.1/applications/console-standard/src/webapp/WEB-INF/view/webmanager/normal.jsp
Sat Apr  8 22:25:06 2006
@@ -2,20 +2,74 @@
 <%@ taglib uri="http://java.sun.com/portlet" prefix="portlet"%>
 <portlet:defineObjects/>
 <c:if test="${statsOn}">
-<table width="50%">
-  <tr><th width="30%">&nbsp;</th><th class="DarkBackground"><strong>Total</strong></th></tr>
-  <tr><td align="right" class="LightBackground"><strong>Requests</strong></td><td
align="center" class="LightBackground">${requests}</td></tr>
-  <tr><td align="right" class="MediumBackground"><strong>Connections</strong></td><td
align="center" class="MediumBackground">${connections}</td></tr>
-  <tr><td align="right" class="LightBackground"><strong>Errors</strong></td><td
align="center" class="LightBackground">${errors}</td></tr>
+<table width="100%">
+  <tr>
+    <th width="25%" class="DarkBackground"><STRONG>Statistic</STRONG></th>
+    <th class="DarkBackground"><strong>Total</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>
+  </tr>
+  <tr>
+    <td align="right"  class="LightBackground"><strong>Total Error Count</strong></td>
+    <td align="center" class="LightBackground">${totalErrorCount}</td>
+  </tr>
 </table>
-<table width="50%">
-  <tr><th width="30%">&nbsp;</th><th class="DarkBackground">Count</th><th
class="DarkBackground">Average</th><th class="DarkBackground">Max</th></tr>
-  <tr><td align="right" class="LightBackground"><strong>Active Requests</strong></td><td
align="center" class="LightBackground">${requestsActive}</td><td align="center"
class="LightBackground">&nbsp;</td><td align="center" class="LightBackground">${requestsActive}</td></tr>
-  <tr><td align="right" class="MediumBackground"><strong>Request Duration</strong></td><td
align="center" class="MediumBackground">&nbsp;</td><td align="center" class="MediumBackground">${requestsDurationAve}</td><td
align="center" class="MediumBackground">${requestsDurationMax}</td></tr>
-  <tr><td align="right" class="LightBackground"><strong>Connections Open</strong></td><td
align="center" class="LightBackground">${connectionsOpen}</td><td align="center"
class="LightBackground">&nbsp;</td><td align="center" class="LightBackground">${connectionsOpenMax}</td></tr>
-  <tr><td align="right" class="MediumBackground"><strong>Connection Requests</strong></td><td
align="center" class="MediumBackground">&nbsp;</td><td align="center" class="MediumBackground">${connectionsRequestsAve}</td><td
align="center" class="MediumBackground">${connectionsRequestsMax}</td></tr>
-  <tr><td align="right" class="LightBackground"><strong>Connection Duration</strong></td><td
align="center" class="LightBackground">&nbsp;</td><td align="center" class="LightBackground">${connectionsDurationAve}</td><td
align="center" class="LightBackground">${connectionsDurationMax}</td></tr>
-  <tr><td colspan="4" align="center"> <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 width="100%">
+  <tr>
+    <th WIDTH="25%" class="DarkBackground"> &nbsp; </th>
+    <th class="DarkBackground"><strong>Current</strong></th>
+    <th class="DarkBackground"><strong>Low</strong></th>
+    <th class="DarkBackground"><strong>High</strong></th>
+  </tr>
+  <tr>
+    <td align="right"  class="LightBackground"><strong>Active Request Count</strong></td>
+    <td align="center" class="LightBackground">${activeRequestCountCurrent}</td>
+    <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>
+  </tr>
+  <tr>
+    <td align="right"  class="LightBackground"><strong>Request Duration</strong></td>
+    <td align="center" class="LightBackground">${requestDurationCount}</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 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>
+  </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}">

Modified: geronimo/branches/1.1/modules/jetty/src/java/org/apache/geronimo/jetty/JettyContainer.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/jetty/src/java/org/apache/geronimo/jetty/JettyContainer.java?rev=392680&r1=392679&r2=392680&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/jetty/src/java/org/apache/geronimo/jetty/JettyContainer.java
(original)
+++ geronimo/branches/1.1/modules/jetty/src/java/org/apache/geronimo/jetty/JettyContainer.java
Sat Apr  8 22:25:06 2006
@@ -47,32 +47,6 @@
 
     long getCollectStatisticsStarted();
 
-    int getConnections();
-
-    int getConnectionsOpen();
-
-    int getConnectionsOpenMax();
-
-    long getConnectionsDurationAve();
-
-    long getConnectionsDurationMax();
-
-    int getConnectionsRequestsAve();
-
-    int getConnectionsRequestsMax();
-
-    int getErrors();
-
-    int getRequests();
-
-    int getRequestsActive();
-
-    int getRequestsActiveMax();
-
-    long getRequestsDurationAve();
-
-    long getRequestsDurationMax();
-
     void setRequestLog(RequestLog log);
 
     /* ------------------------------------------------------------ */

Modified: geronimo/branches/1.1/modules/jetty/src/java/org/apache/geronimo/jetty/JettyContainerImpl.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/jetty/src/java/org/apache/geronimo/jetty/JettyContainerImpl.java?rev=392680&r1=392679&r2=392680&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/jetty/src/java/org/apache/geronimo/jetty/JettyContainerImpl.java
(original)
+++ geronimo/branches/1.1/modules/jetty/src/java/org/apache/geronimo/jetty/JettyContainerImpl.java
Sat Apr  8 22:25:06 2006
@@ -24,23 +24,28 @@
 import org.apache.geronimo.gbean.GBeanLifecycle;
 import org.apache.geronimo.webservices.SoapHandler;
 import org.apache.geronimo.webservices.WebServiceContainer;
+import org.apache.geronimo.management.StatisticsProvider;
 import org.mortbay.http.HttpContext;
 import org.mortbay.http.HttpListener;
 import org.mortbay.http.RequestLog;
 import org.mortbay.http.UserRealm;
 import org.mortbay.jetty.Server;
 
+import javax.management.j2ee.statistics.Stats;
+
 /**
  * @version $Rev$ $Date$
  */
-public class JettyContainerImpl implements JettyContainer, SoapHandler, GBeanLifecycle {
+public class JettyContainerImpl implements JettyContainer, SoapHandler, GBeanLifecycle, StatisticsProvider
{
     private final Server server;
     private final Map webServices = new HashMap();
     private final String objectName;
+    private JettyWebContainerStatsImpl stats;
 
     public JettyContainerImpl(String objectName) {
         this.objectName = objectName;
         server = new JettyServer();
+        stats = new JettyWebContainerStatsImpl();
     }
 
     public String getObjectName() {
@@ -52,7 +57,7 @@
     }
 
     public boolean isStatisticsProvider() {
-        return false; // todo: return true once stats are integrated
+        return true;
     }
 
     public boolean isEventProvider() {
@@ -65,6 +70,7 @@
 
     public void setCollectStatistics(boolean on) {
         server.setStatsOn(on);
+        stats.setStatsOn(on);
     }
 
     public boolean getCollectStatistics() {
@@ -75,56 +81,52 @@
         return server.getStatsOnMs();
     }
 
-    public int getConnections() {
-        return server.getConnections();
-    }
-
-    public int getConnectionsOpen() {
-        return server.getConnectionsOpen();
-    }
-
-    public int getConnectionsOpenMax() {
-        return server.getConnectionsOpenMax();
-    }
-
-    public long getConnectionsDurationAve() {
-        return server.getConnectionsDurationAve();
-    }
+    public Stats getStats() {
+        if (getCollectStatistics()) {
 
-    public long getConnectionsDurationMax() {
-        return server.getConnectionsDurationMax();
-    }
+            /* set active request count */
+            stats.getTotalRequestCountImpl().setCount(server.getRequests());
 
-    public int getConnectionsRequestsAve() {
-        return server.getConnectionsRequestsAve();
-    }
+            /* set total connection count */
+            stats.getTotalConnectionCountImpl().setCount(server.getConnections());
 
-    public int getConnectionsRequestsMax() {
-        return server.getConnectionsRequestsMax();
-    }
+            /* set total error count */
+            stats.getTotalErrorCountImpl().setCount(server.getErrors());
+
+            /* 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 jetty
+            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());
+
+            /* 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 jetty
+            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 jetty
+            stats.getConnectionDurationImpl().setCount(stats.getTotalConnectionCount().getCount());
+            stats.getConnectionDurationImpl().setTotalTime(server.getConnectionsDurationTotal());
 
-    public int getErrors() {
-        return server.getErrors();
-    }
-
-    public int getRequests() {
-        return server.getRequests();
-    }
-
-    public int getRequestsActive() {
-        return server.getRequestsActive();
-    }
-
-    public int getRequestsActiveMax() {
-        return server.getRequestsActiveMax();
-    }
-
-    public long getRequestsDurationAve() {
-        return server.getRequestsDurationAve();
-    }
-
-    public long getRequestsDurationMax() {
-        return server.getRequestsDurationMax();
+        } else {
+            // should probably set the stats object to all zero/null values to avoid unpredicable
results
+        }
+        return stats;
     }
 
     public void addListener(HttpListener listener) {
@@ -197,21 +199,7 @@
     static {
         GBeanInfoBuilder infoBuilder = GBeanInfoBuilder.createStatic("Jetty Web Container",
JettyContainerImpl.class);
         infoBuilder.addAttribute("collectStatistics", Boolean.TYPE, true);
-        //todo: Move all statistics methods to a Stats implementation
         infoBuilder.addAttribute("collectStatisticsStarted", Long.TYPE, false);
-        infoBuilder.addAttribute("connections", Integer.TYPE, false);
-        infoBuilder.addAttribute("connectionsOpen", Integer.TYPE, false);
-        infoBuilder.addAttribute("connectionsOpenMax", Integer.TYPE, false);
-        infoBuilder.addAttribute("connectionsDurationAve", Long.TYPE, false);
-        infoBuilder.addAttribute("connectionsDurationMax", Long.TYPE, false);
-        infoBuilder.addAttribute("connectionsRequestsAve", Integer.TYPE, false);
-        infoBuilder.addAttribute("connectionsRequestsMax", Integer.TYPE, false);
-        infoBuilder.addAttribute("errors", Integer.TYPE, false);
-        infoBuilder.addAttribute("requests", Integer.TYPE, false);
-        infoBuilder.addAttribute("requestsActive", Integer.TYPE, false);
-        infoBuilder.addAttribute("requestsActiveMax", Integer.TYPE, false);
-        infoBuilder.addAttribute("requestsDurationAve", Long.TYPE, false);
-        infoBuilder.addAttribute("requestsDurationMax", Long.TYPE, false);
         infoBuilder.addOperation("resetStatistics");
 
         infoBuilder.addAttribute("requestLog", RequestLog.class, false, false);
@@ -227,6 +215,7 @@
 
         infoBuilder.addInterface(SoapHandler.class);
         infoBuilder.addInterface(JettyContainer.class);
+        infoBuilder.addInterface(StatisticsProvider.class);
         infoBuilder.setConstructor(new String[]{"objectName"});
 
         GBEAN_INFO = infoBuilder.getBeanInfo();

Added: geronimo/branches/1.1/modules/jetty/src/java/org/apache/geronimo/jetty/JettyWebContainerStats.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/jetty/src/java/org/apache/geronimo/jetty/JettyWebContainerStats.java?rev=392680&view=auto
==============================================================================
--- geronimo/branches/1.1/modules/jetty/src/java/org/apache/geronimo/jetty/JettyWebContainerStats.java
(added)
+++ geronimo/branches/1.1/modules/jetty/src/java/org/apache/geronimo/jetty/JettyWebContainerStats.java
Sat Apr  8 22:25:06 2006
@@ -0,0 +1,27 @@
+/**
+ *
+ * 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.jetty;
+
+import org.apache.geronimo.management.geronimo.stats.WebContainerStats;
+
+/**
+ * Token interface to distinguish Jetty implementations.
+ *
+ * @version $Rev: 46019 $ $Date: 2004-09-14 05:56:06 -0400 (Tue, 14 Sep 2004) $
+ */
+public interface JettyWebContainerStats extends WebContainerStats {
+}

Propchange: geronimo/branches/1.1/modules/jetty/src/java/org/apache/geronimo/jetty/JettyWebContainerStats.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: geronimo/branches/1.1/modules/jetty/src/java/org/apache/geronimo/jetty/JettyWebContainerStatsImpl.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/jetty/src/java/org/apache/geronimo/jetty/JettyWebContainerStatsImpl.java?rev=392680&r1=392679&r2=392680&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/jetty/src/java/org/apache/geronimo/jetty/JettyWebContainerStatsImpl.java
(original)
+++ geronimo/branches/1.1/modules/jetty/src/java/org/apache/geronimo/jetty/JettyWebContainerStatsImpl.java
Sat Apr  8 22:25:06 2006
@@ -1,21 +1,22 @@
 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.RangeStatisticImpl;
 import org.apache.geronimo.management.stats.StatisticImpl;
+import org.apache.geronimo.management.stats.StatsImpl;
+import org.apache.geronimo.management.stats.TimeStatisticImpl;
+
+import javax.management.j2ee.statistics.CountStatistic;
+import javax.management.j2ee.statistics.RangeStatistic;
+import javax.management.j2ee.statistics.TimeStatistic;
 
 /**
  * Jetty implementation of the Geronimo stats interface WebContainerStats
  *
  * @version $Revision: 1.0$
  */
-public class JettyWebContainerStatsImpl extends StatsImpl implements WebContainerStats {
+public class JettyWebContainerStatsImpl extends StatsImpl implements JettyWebContainerStats
{
+    private CountStatisticImpl totalConnectionCount;
     private RangeStatisticImpl openConnectionCount;
     private RangeStatisticImpl connectionRequestCount;
     private TimeStatisticImpl connectionDuration;
@@ -23,8 +24,11 @@
     private CountStatisticImpl totalRequestCount;
     private RangeStatisticImpl activeRequestCount;
     private TimeStatisticImpl requestDuration;
+    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,
@@ -38,8 +42,9 @@
         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");
+                "The length of time that it's taken to handle individual requests");
 
+        addStat("TotalConnectionCount", totalConnectionCount);
         addStat("OpenConnectionCount", openConnectionCount);
         addStat("ConnectionRequestCount", connectionRequestCount);
         addStat("ConnectionDuration", connectionDuration);
@@ -48,6 +53,11 @@
         addStat("ActiveRequestCount", activeRequestCount);
         addStat("RequestDuration", requestDuration);
     }
+
+    public CountStatistic getTotalConnectionCount() {
+        return totalConnectionCount;
+    }
+
     public RangeStatistic getOpenConnectionCount() {
         return openConnectionCount;
     }
@@ -74,6 +84,18 @@
 
     public TimeStatistic getRequestDuration() {
         return requestDuration;
+    }
+
+    public boolean isStatsOn() {
+        return statsOn;
+    }
+
+    public void setStatsOn(boolean on) {
+        statsOn = on;
+    }
+
+    public CountStatisticImpl getTotalConnectionCountImpl() {
+        return totalConnectionCount;
     }
 
     public RangeStatisticImpl getOpenConnectionCountImpl() {

Modified: geronimo/branches/1.1/modules/management/src/java/org/apache/geronimo/management/geronimo/stats/WebContainerStats.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/management/src/java/org/apache/geronimo/management/geronimo/stats/WebContainerStats.java?rev=392680&r1=392679&r2=392680&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/management/src/java/org/apache/geronimo/management/geronimo/stats/WebContainerStats.java
(original)
+++ geronimo/branches/1.1/modules/management/src/java/org/apache/geronimo/management/geronimo/stats/WebContainerStats.java
Sat Apr  8 22:25:06 2006
@@ -30,6 +30,11 @@
  */
 public interface WebContainerStats extends Stats {
     /**
+     * Gets the total number of connections thus far
+     */
+    CountStatistic getTotalConnectionCount();
+ 
+    /**
      * Gets the number of connections currently open (as well as the min and
      * max since statistics gathering started).
      */
@@ -70,4 +75,9 @@
      * figures across all requests since statistics gathering started)
      */
     TimeStatistic getRequestDuration();
+
+    /**
+     * Gets the current state of statistics collection (on or off)
+     */
+    boolean isStatsOn();
 }



Mime
View raw message