cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r942124 - in /cxf/branches/2.2.x-fixes: ./ rt/management/src/main/java/org/apache/cxf/management/counters/ResponseTimeCounter.java rt/management/src/test/java/org/apache/cxf/management/counters/CounterRepositoryTest.java
Date Fri, 07 May 2010 15:25:34 GMT
Author: dkulp
Date: Fri May  7 15:25:34 2010
New Revision: 942124

URL: http://svn.apache.org/viewvc?rev=942124&view=rev
Log:
Merged revisions 942123 via svnmerge from 
https://svn.apache.org/repos/asf/cxf/trunk

........
  r942123 | dkulp | 2010-05-07 11:24:30 -0400 (Fri, 07 May 2010) | 1 line
  
  [CXF-2804] Allow reset of response counters
........

Modified:
    cxf/branches/2.2.x-fixes/   (props changed)
    cxf/branches/2.2.x-fixes/rt/management/src/main/java/org/apache/cxf/management/counters/ResponseTimeCounter.java
    cxf/branches/2.2.x-fixes/rt/management/src/test/java/org/apache/cxf/management/counters/CounterRepositoryTest.java

Propchange: cxf/branches/2.2.x-fixes/
------------------------------------------------------------------------------
    svn:mergeinfo = /cxf/trunk:942123

Propchange: cxf/branches/2.2.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: cxf/branches/2.2.x-fixes/rt/management/src/main/java/org/apache/cxf/management/counters/ResponseTimeCounter.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/management/src/main/java/org/apache/cxf/management/counters/ResponseTimeCounter.java?rev=942124&r1=942123&r2=942124&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/rt/management/src/main/java/org/apache/cxf/management/counters/ResponseTimeCounter.java
(original)
+++ cxf/branches/2.2.x-fixes/rt/management/src/main/java/org/apache/cxf/management/counters/ResponseTimeCounter.java
Fri May  7 15:25:34 2010
@@ -84,6 +84,18 @@ public class ResponseTimeCounter impleme
             minHandlingTime = handlingTime;
         }
     }
+
+    public void reset() {
+        invocations.set(0);
+        checkedApplicationFaults.set(0);
+        unCheckedApplicationFaults.set(0);
+        runtimeFaults.set(0);
+        logicalRuntimeFaults.set(0);
+        
+        totalHandlingTime = 0;    
+        maxHandlingTime = 0;
+        minHandlingTime = Integer.MAX_VALUE;   
+    }
     
     public ObjectName getObjectName() {
         return objectName;

Modified: cxf/branches/2.2.x-fixes/rt/management/src/test/java/org/apache/cxf/management/counters/CounterRepositoryTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/management/src/test/java/org/apache/cxf/management/counters/CounterRepositoryTest.java?rev=942124&r1=942123&r2=942124&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/rt/management/src/test/java/org/apache/cxf/management/counters/CounterRepositoryTest.java
(original)
+++ cxf/branches/2.2.x-fixes/rt/management/src/test/java/org/apache/cxf/management/counters/CounterRepositoryTest.java
Fri May  7 15:25:34 2010
@@ -132,6 +132,16 @@ public class CounterRepositoryTest exten
                      opCounter.getMinResponseTime(), (long)1000);
         assertEquals("The Service counter isn't increased", sCounter.getNumInvocations(),
2);
         
+        opCounter.reset();
+        assertTrue(opCounter.getNumCheckedApplicationFaults().intValue() == 0);
+        assertTrue(opCounter.getNumInvocations().intValue() == 0);
+        assertTrue(opCounter.getNumLogicalRuntimeFaults().intValue() == 0);
+        assertTrue(opCounter.getNumRuntimeFaults().intValue() == 0);
+        assertTrue(opCounter.getNumUnCheckedApplicationFaults().intValue() == 0);
+        assertTrue(opCounter.getTotalHandlingTime().intValue() == 0);
+        assertTrue(opCounter.getMinResponseTime().longValue() == Integer.MAX_VALUE);
+        assertTrue(opCounter.getMaxResponseTime().intValue() == 0);
+        
         EasyMock.verify(bus);
         EasyMock.verify(mhtr1);
         EasyMock.verify(mhtr2);



Mime
View raw message