geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akulshresh...@apache.org
Subject svn commit: r596514 - in /geronimo/server/trunk: framework/modules/geronimo-management/src/main/java/org/apache/geronimo/management/geronimo/stats/ plugins/jetty/geronimo-jetty6/src/main/java/org/apache/geronimo/jetty6/ plugins/jetty/geronimo-jetty6/sr...
Date Tue, 20 Nov 2007 01:56:23 GMT
Author: akulshreshtha
Date: Mon Nov 19 17:56:22 2007
New Revision: 596514

URL: http://svn.apache.org/viewvc?rev=596514&view=rev
Log:
GERONIMO-3608 Move Jetty*Stats and Jetty*StatsImpl to geronimo-management

Added:
    geronimo/server/trunk/framework/modules/geronimo-management/src/main/java/org/apache/geronimo/management/geronimo/stats/JettyWebConnectorStats.java
      - copied, changed from r595288, geronimo/server/trunk/plugins/jetty/geronimo-jetty6/src/main/java/org/apache/geronimo/jetty6/JettyWebConnectorStats.java
    geronimo/server/trunk/framework/modules/geronimo-management/src/main/java/org/apache/geronimo/management/geronimo/stats/JettyWebConnectorStatsImpl.java
      - copied, changed from r595288, geronimo/server/trunk/plugins/jetty/geronimo-jetty6/src/main/java/org/apache/geronimo/jetty6/JettyWebConnectorStatsImpl.java
    geronimo/server/trunk/framework/modules/geronimo-management/src/main/java/org/apache/geronimo/management/geronimo/stats/JettyWebContainerStats.java
      - copied, changed from r595288, geronimo/server/trunk/plugins/jetty/geronimo-jetty6/src/main/java/org/apache/geronimo/jetty6/JettyWebContainerStats.java
    geronimo/server/trunk/framework/modules/geronimo-management/src/main/java/org/apache/geronimo/management/geronimo/stats/JettyWebContainerStatsImpl.java
      - copied, changed from r595288, geronimo/server/trunk/plugins/jetty/geronimo-jetty6/src/main/java/org/apache/geronimo/jetty6/JettyWebContainerStatsImpl.java
Removed:
    geronimo/server/trunk/plugins/jetty/geronimo-jetty6/src/main/java/org/apache/geronimo/jetty6/JettyWebConnectorStats.java
    geronimo/server/trunk/plugins/jetty/geronimo-jetty6/src/main/java/org/apache/geronimo/jetty6/JettyWebConnectorStatsImpl.java
    geronimo/server/trunk/plugins/jetty/geronimo-jetty6/src/main/java/org/apache/geronimo/jetty6/JettyWebContainerStats.java
    geronimo/server/trunk/plugins/jetty/geronimo-jetty6/src/main/java/org/apache/geronimo/jetty6/JettyWebContainerStatsImpl.java
Modified:
    geronimo/server/trunk/plugins/jetty/geronimo-jetty6/src/main/java/org/apache/geronimo/jetty6/JettyContainerImpl.java
    geronimo/server/trunk/plugins/jetty/geronimo-jetty6/src/main/java/org/apache/geronimo/jetty6/connector/JettyConnector.java
    geronimo/server/trunk/plugins/jetty/geronimo-jetty6/src/test/java/org/apache/geronimo/jetty6/StatTest.java

Copied: geronimo/server/trunk/framework/modules/geronimo-management/src/main/java/org/apache/geronimo/management/geronimo/stats/JettyWebConnectorStats.java
(from r595288, geronimo/server/trunk/plugins/jetty/geronimo-jetty6/src/main/java/org/apache/geronimo/jetty6/JettyWebConnectorStats.java)
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-management/src/main/java/org/apache/geronimo/management/geronimo/stats/JettyWebConnectorStats.java?p2=geronimo/server/trunk/framework/modules/geronimo-management/src/main/java/org/apache/geronimo/management/geronimo/stats/JettyWebConnectorStats.java&p1=geronimo/server/trunk/plugins/jetty/geronimo-jetty6/src/main/java/org/apache/geronimo/jetty6/JettyWebConnectorStats.java&r1=595288&r2=596514&rev=596514&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/jetty/geronimo-jetty6/src/main/java/org/apache/geronimo/jetty6/JettyWebConnectorStats.java
(original)
+++ geronimo/server/trunk/framework/modules/geronimo-management/src/main/java/org/apache/geronimo/management/geronimo/stats/JettyWebConnectorStats.java
Mon Nov 19 17:56:22 2007
@@ -15,7 +15,7 @@
  *  limitations under the License.
  */
 
-package org.apache.geronimo.jetty6;
+package org.apache.geronimo.management.geronimo.stats;
 
 import org.apache.geronimo.management.geronimo.stats.WebConnectorStats;
 

Copied: geronimo/server/trunk/framework/modules/geronimo-management/src/main/java/org/apache/geronimo/management/geronimo/stats/JettyWebConnectorStatsImpl.java
(from r595288, geronimo/server/trunk/plugins/jetty/geronimo-jetty6/src/main/java/org/apache/geronimo/jetty6/JettyWebConnectorStatsImpl.java)
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-management/src/main/java/org/apache/geronimo/management/geronimo/stats/JettyWebConnectorStatsImpl.java?p2=geronimo/server/trunk/framework/modules/geronimo-management/src/main/java/org/apache/geronimo/management/geronimo/stats/JettyWebConnectorStatsImpl.java&p1=geronimo/server/trunk/plugins/jetty/geronimo-jetty6/src/main/java/org/apache/geronimo/jetty6/JettyWebConnectorStatsImpl.java&r1=595288&r2=596514&rev=596514&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/jetty/geronimo-jetty6/src/main/java/org/apache/geronimo/jetty6/JettyWebConnectorStatsImpl.java
(original)
+++ geronimo/server/trunk/framework/modules/geronimo-management/src/main/java/org/apache/geronimo/management/geronimo/stats/JettyWebConnectorStatsImpl.java
Mon Nov 19 17:56:22 2007
@@ -18,7 +18,7 @@
  */
 
 
-package org.apache.geronimo.jetty6;
+package org.apache.geronimo.management.geronimo.stats;
 
 import org.apache.geronimo.management.stats.CountStatisticImpl;
 import org.apache.geronimo.management.stats.RangeStatisticImpl;

Copied: geronimo/server/trunk/framework/modules/geronimo-management/src/main/java/org/apache/geronimo/management/geronimo/stats/JettyWebContainerStats.java
(from r595288, geronimo/server/trunk/plugins/jetty/geronimo-jetty6/src/main/java/org/apache/geronimo/jetty6/JettyWebContainerStats.java)
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-management/src/main/java/org/apache/geronimo/management/geronimo/stats/JettyWebContainerStats.java?p2=geronimo/server/trunk/framework/modules/geronimo-management/src/main/java/org/apache/geronimo/management/geronimo/stats/JettyWebContainerStats.java&p1=geronimo/server/trunk/plugins/jetty/geronimo-jetty6/src/main/java/org/apache/geronimo/jetty6/JettyWebContainerStats.java&r1=595288&r2=596514&rev=596514&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/jetty/geronimo-jetty6/src/main/java/org/apache/geronimo/jetty6/JettyWebContainerStats.java
(original)
+++ geronimo/server/trunk/framework/modules/geronimo-management/src/main/java/org/apache/geronimo/management/geronimo/stats/JettyWebContainerStats.java
Mon Nov 19 17:56:22 2007
@@ -14,7 +14,7 @@
  *  See the License for the specific language governing permissions and
  *  limitations under the License.
  */
-package org.apache.geronimo.jetty6;
+package org.apache.geronimo.management.geronimo.stats;
 
 import org.apache.geronimo.management.geronimo.stats.WebContainerStats;
 

Copied: geronimo/server/trunk/framework/modules/geronimo-management/src/main/java/org/apache/geronimo/management/geronimo/stats/JettyWebContainerStatsImpl.java
(from r595288, geronimo/server/trunk/plugins/jetty/geronimo-jetty6/src/main/java/org/apache/geronimo/jetty6/JettyWebContainerStatsImpl.java)
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-management/src/main/java/org/apache/geronimo/management/geronimo/stats/JettyWebContainerStatsImpl.java?p2=geronimo/server/trunk/framework/modules/geronimo-management/src/main/java/org/apache/geronimo/management/geronimo/stats/JettyWebContainerStatsImpl.java&p1=geronimo/server/trunk/plugins/jetty/geronimo-jetty6/src/main/java/org/apache/geronimo/jetty6/JettyWebContainerStatsImpl.java&r1=595288&r2=596514&rev=596514&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/jetty/geronimo-jetty6/src/main/java/org/apache/geronimo/jetty6/JettyWebContainerStatsImpl.java
(original)
+++ geronimo/server/trunk/framework/modules/geronimo-management/src/main/java/org/apache/geronimo/management/geronimo/stats/JettyWebContainerStatsImpl.java
Mon Nov 19 17:56:22 2007
@@ -14,7 +14,7 @@
  *  See the License for the specific language governing permissions and
  *  limitations under the License.
  */
-package org.apache.geronimo.jetty6;
+package org.apache.geronimo.management.geronimo.stats;
 
 import javax.management.j2ee.statistics.CountStatistic;
 import javax.management.j2ee.statistics.RangeStatistic;
@@ -69,18 +69,18 @@
         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);
+        addStat("Responses1xx", response1xx);
+        addStat("Responses2xx", response2xx);
+        addStat("Responses3xx", response3xx);
+        addStat("Responses4xx", response4xx);
+        addStat("Responses5xx", response5xx);
+        addStat("StatsDuration", statsOnMs); // TODO - remove this
     }
 
 /**
  * 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.
+ * These are used by the objects (such as the web console) that
+ * retrieve the stats for presentation purposes.
  */
 
     public CountStatistic getTotalRequestCount() {

Modified: geronimo/server/trunk/plugins/jetty/geronimo-jetty6/src/main/java/org/apache/geronimo/jetty6/JettyContainerImpl.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/jetty/geronimo-jetty6/src/main/java/org/apache/geronimo/jetty6/JettyContainerImpl.java?rev=596514&r1=596513&r2=596514&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/jetty/geronimo-jetty6/src/main/java/org/apache/geronimo/jetty6/JettyContainerImpl.java
(original)
+++ geronimo/server/trunk/plugins/jetty/geronimo-jetty6/src/main/java/org/apache/geronimo/jetty6/JettyContainerImpl.java
Mon Nov 19 17:56:22 2007
@@ -29,6 +29,7 @@
 import org.apache.geronimo.management.LazyStatisticsProvider;
 import org.apache.geronimo.management.geronimo.NetworkConnector;
 import org.apache.geronimo.management.geronimo.WebManager;
+import org.apache.geronimo.management.geronimo.stats.JettyWebContainerStatsImpl;
 import org.apache.geronimo.system.serverinfo.ServerInfo;
 import org.apache.geronimo.webservices.SoapHandler;
 import org.apache.geronimo.webservices.WebServiceContainer;

Modified: geronimo/server/trunk/plugins/jetty/geronimo-jetty6/src/main/java/org/apache/geronimo/jetty6/connector/JettyConnector.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/jetty/geronimo-jetty6/src/main/java/org/apache/geronimo/jetty6/connector/JettyConnector.java?rev=596514&r1=596513&r2=596514&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/jetty/geronimo-jetty6/src/main/java/org/apache/geronimo/jetty6/connector/JettyConnector.java
(original)
+++ geronimo/server/trunk/plugins/jetty/geronimo-jetty6/src/main/java/org/apache/geronimo/jetty6/connector/JettyConnector.java
Mon Nov 19 17:56:22 2007
@@ -29,8 +29,8 @@
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
 import org.apache.geronimo.jetty6.JettyContainer;
 import org.apache.geronimo.jetty6.JettyWebConnector;
-import org.apache.geronimo.jetty6.JettyWebConnectorStatsImpl;
 import org.apache.geronimo.management.LazyStatisticsProvider;
+import org.apache.geronimo.management.geronimo.stats.JettyWebConnectorStatsImpl;
 import org.apache.geronimo.system.threads.ThreadPool;
 import org.mortbay.jetty.AbstractConnector;
 

Modified: geronimo/server/trunk/plugins/jetty/geronimo-jetty6/src/test/java/org/apache/geronimo/jetty6/StatTest.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/jetty/geronimo-jetty6/src/test/java/org/apache/geronimo/jetty6/StatTest.java?rev=596514&r1=596513&r2=596514&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/jetty/geronimo-jetty6/src/test/java/org/apache/geronimo/jetty6/StatTest.java
(original)
+++ geronimo/server/trunk/plugins/jetty/geronimo-jetty6/src/test/java/org/apache/geronimo/jetty6/StatTest.java
Mon Nov 19 17:56:22 2007
@@ -33,17 +33,20 @@
 public class StatTest extends AbstractWebModuleTest {
 
     private ObjectName webModuleName;
+    
+    public void testContainerStats() throws Exception {
+	statsTest(container);
+    }
 
-    public void testStats() throws Exception {
-        JettyWebAppContext app;
-        app = setUpAppContext(null, null, null, null, null, null, null, "war1/");
-
-        setUpStaticContentServlet(app);
-        
+    public void testConnectorStats() throws Exception {
+	statsTest(connector);
+    }
+    
+    public void statsTest(LazyStatisticsProvider component) throws Exception {       
         // start statistics collection
-        if (connector instanceof LazyStatisticsProvider) {
-        assertTrue("Stats should be off initially", !connector.isStatsOn());
-        connector.setStatsOn(true);
+        if (component instanceof LazyStatisticsProvider) {
+        assertTrue("Stats should be off initially", !component.isStatsOn());
+        component.setStatsOn(true);
         }
         int n = 4; // no of connections
         for (int k = 0; k < n; k++) {
@@ -53,31 +56,27 @@
             assertEquals(HttpURLConnection.HTTP_OK, connection.getResponseCode());
             assertEquals("Hello World", reader.readLine());
             
-            Stats[] allStats = {connector.getStats()};
-            Stats stats;
-            for (int j = 0; j < allStats.length; j++) {
-                stats = allStats[j];
-                Statistic[] stts = stats.getStatistics();
-                Statistic aStts;
-                String[] sttsNames = stats.getStatisticNames();
-                for (int i = 0; i < sttsNames.length; i++) {
-                    // check that the names match the getter methods
-                    String sttsName = sttsNames[i];
-                    assertFalse(sttsName.equals(stts[i].getName()));
-                    try {
-                    stats.getClass().getMethod("get" + sttsName, new Class[0]);
-                    } catch (NoSuchMethodException e) {
-                	continue; // ignore this statistics JSR77.6.10.1.1
-                    }
-                    aStts = stats.getStatistic(sttsName);
-                    assertTrue("startTime was not set for " + sttsName, aStts.getStartTime()
!= 0);
-                    assertTrue("lastSampleTime was not set for " + sttsName, aStts.getLastSampleTime()
!= 0);
-                    /* System.out.println("              lastSampleTime = " + aStts.getLastSampleTime()
+ 
-                	    "  startTime = " + aStts.getStartTime());
-                    System.out.println(aStts);*/
+            Stats stats = component.getStats();
+            Statistic[] stts = stats.getStatistics();
+            Statistic aStts;
+            String[] sttsNames = stats.getStatisticNames();
+            for (int i = 0; i < sttsNames.length; i++) {
+                // check that the names match the getter methods
+                String sttsName = sttsNames[i];
+                assertFalse(sttsName.equals(stts[i].getName()));
+                try {
+                stats.getClass().getMethod("get" + sttsName, new Class[0]);
+                } catch (NoSuchMethodException e) {
+            	continue; // ignore this statistics for now, JSR77.6.10.1.1
                 }
+                aStts = stats.getStatistic(sttsName);
+                assertTrue("startTime was not set for " + sttsName, aStts.getStartTime()
!= 0);
+                assertTrue("lastSampleTime was not set for " + sttsName, aStts.getLastSampleTime()
!= 0);
+                /*System.out.println("              lastSampleTime = " + aStts.getLastSampleTime()
+ 
+            	    "  startTime = " + aStts.getStartTime());
+                System.out.println(aStts);*/
             }
-            if (k == n-2) connector.resetStats(); // test reset
+            if (k == n-2) component.resetStats(); // test reset
             connection.disconnect();
             Thread.sleep(1000);  // connection interval
         }       
@@ -85,5 +84,8 @@
 
     protected void setUp() throws Exception {
         super.setUp();
+        JettyWebAppContext app;
+        app = setUpAppContext(null, null, null, null, null, null, null, "war1/");
+        setUpStaticContentServlet(app);
     }
 }



Mime
View raw message