cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject git commit: [CXF-5615] Resetting min and average response time counters to 0
Date Fri, 14 Mar 2014 11:12:29 GMT
Repository: cxf
Updated Branches:
  refs/heads/master bd6138034 -> 926ba99bf


[CXF-5615] Resetting min and average response time counters to 0


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/926ba99b
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/926ba99b
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/926ba99b

Branch: refs/heads/master
Commit: 926ba99bf3fb933b7f7fa6512b6c4464452d8578
Parents: bd61380
Author: Sergey Beryozkin <sberyozkin@talend.com>
Authored: Fri Mar 14 11:12:10 2014 +0000
Committer: Sergey Beryozkin <sberyozkin@talend.com>
Committed: Fri Mar 14 11:12:10 2014 +0000

----------------------------------------------------------------------
 .../org/apache/cxf/management/counters/ResponseTimeCounter.java  | 4 ++--
 .../apache/cxf/management/counters/CounterRepositoryTest.java    | 3 ++-
 2 files changed, 4 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/926ba99b/rt/management/src/main/java/org/apache/cxf/management/counters/ResponseTimeCounter.java
----------------------------------------------------------------------
diff --git a/rt/management/src/main/java/org/apache/cxf/management/counters/ResponseTimeCounter.java
b/rt/management/src/main/java/org/apache/cxf/management/counters/ResponseTimeCounter.java
index 0249361..86ce8cb 100644
--- a/rt/management/src/main/java/org/apache/cxf/management/counters/ResponseTimeCounter.java
+++ b/rt/management/src/main/java/org/apache/cxf/management/counters/ResponseTimeCounter.java
@@ -94,7 +94,7 @@ public class ResponseTimeCounter implements ResponseTimeCounterMBean, Counter
{
         
         totalHandlingTime = 0;    
         maxHandlingTime = 0;
-        minHandlingTime = Integer.MAX_VALUE;   
+        minHandlingTime = 0;   
     }
     
     public ObjectName getObjectName() {
@@ -103,7 +103,7 @@ public class ResponseTimeCounter implements ResponseTimeCounterMBean,
Counter {
 
     public Number getAvgResponseTime() {        
         if (invocations.get() == 0) {
-            return -1; //return -1 if invocation number is 0;
+            return 0;
         }
         return (int)(totalHandlingTime / invocations.get());
     }

http://git-wip-us.apache.org/repos/asf/cxf/blob/926ba99b/rt/management/src/test/java/org/apache/cxf/management/counters/CounterRepositoryTest.java
----------------------------------------------------------------------
diff --git a/rt/management/src/test/java/org/apache/cxf/management/counters/CounterRepositoryTest.java
b/rt/management/src/test/java/org/apache/cxf/management/counters/CounterRepositoryTest.java
index ac4713a..6571c92 100644
--- a/rt/management/src/test/java/org/apache/cxf/management/counters/CounterRepositoryTest.java
+++ b/rt/management/src/test/java/org/apache/cxf/management/counters/CounterRepositoryTest.java
@@ -151,8 +151,9 @@ public class CounterRepositoryTest extends Assert {
         assertTrue(opCounter.getNumRuntimeFaults().intValue() == 0);
         assertTrue(opCounter.getNumUnCheckedApplicationFaults().intValue() == 0);
         assertTrue(opCounter.getTotalHandlingTime().intValue() == 0);
-        assertTrue(opCounter.getMinResponseTime().longValue() == Integer.MAX_VALUE);
+        assertTrue(opCounter.getMinResponseTime().intValue() == 0);
         assertTrue(opCounter.getMaxResponseTime().intValue() == 0);
+        assertTrue(opCounter.getAvgResponseTime().intValue() == 0);
         
         verifyBus();
         EasyMock.verify(mhtr1);


Mime
View raw message