camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject svn commit: r663830 - in /activemq/camel/trunk/camel-core/src: main/java/org/apache/camel/management/ test/java/org/apache/camel/management/
Date Fri, 06 Jun 2008 06:01:21 GMT
Author: davsclaus
Date: Thu Jun  5 23:01:20 2008
New Revision: 663830

URL: http://svn.apache.org/viewvc?rev=663830&view=rev
Log:
CAMEL-578: Using millis for timing instead of nano. Applied patch with thanks to William Tam

Modified:
    activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/management/InstrumentationProcessor.java
    activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/management/PerformanceCounter.java
    activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/management/JmxInstrumentationUsingDefaultsTest.java

Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/management/InstrumentationProcessor.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/management/InstrumentationProcessor.java?rev=663830&r1=663829&r2=663830&view=diff
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/management/InstrumentationProcessor.java
(original)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/management/InstrumentationProcessor.java
Thu Jun  5 23:01:20 2008
@@ -39,11 +39,11 @@
     }
     
     public void process(Exchange exchange) throws Exception {
-        long startTime = System.nanoTime();
+        long startTime = System.currentTimeMillis();
         super.process(exchange);
         if (counter != null) {
             if (!exchange.isFailed()) {
-                counter.completedExchange(System.nanoTime() - startTime);
+                counter.completedExchange(System.currentTimeMillis() - startTime);
             } else {
                 counter.completedExchange();
             }

Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/management/PerformanceCounter.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/management/PerformanceCounter.java?rev=663830&r1=663829&r2=663830&view=diff
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/management/PerformanceCounter.java
(original)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/management/PerformanceCounter.java
Thu Jun  5 23:01:20 2008
@@ -56,18 +56,18 @@
         return numExchanges.get() - numCompleted.get();
     }
 
-    @ManagedAttribute(description = "Min Processing Time [ns]")
+    @ManagedAttribute(description = "Min Processing Time [milli-seconds]")
     public synchronized long getMinProcessingTime() throws Exception {
         return minProcessingTime;
     }
 
-    @ManagedAttribute(description = "Mean Processing Time [ns]")
+    @ManagedAttribute(description = "Mean Processing Time [milli-seconds]")
     public synchronized long getMeanProcessingTime() throws Exception {
         long count = numCompleted.get();
         return count > 0 ? (long)totalProcessingTime / count : 0L;
     }
 
-    @ManagedAttribute(description = "Max Processing Time [ns]")
+    @ManagedAttribute(description = "Max Processing Time [milli-seconds]")
     public synchronized long getMaxProcessingTime() throws Exception {
         return maxProcessingTime;
     }

Modified: activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/management/JmxInstrumentationUsingDefaultsTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/management/JmxInstrumentationUsingDefaultsTest.java?rev=663830&r1=663829&r2=663830&view=diff
==============================================================================
--- activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/management/JmxInstrumentationUsingDefaultsTest.java
(original)
+++ activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/management/JmxInstrumentationUsingDefaultsTest.java
Thu Jun  5 23:01:20 2008
@@ -102,12 +102,12 @@
         assertNotNull("Expected attribute not found. MBean registerred under a "
                       + "'<domain>:name=Stats,*' key must be of type PerformanceCounter.class",
                       valueofMinProcessingTime);
-        assertTrue(valueofMinProcessingTime > 0);
+        assertTrue(valueofMinProcessingTime >= 0);
         Long valueofMaxProcessingTime = (Long)mbs.getAttribute(pcob, "MaxProcessingTime");
         assertNotNull("Expected attribute not found. MBean registerred under a "
                       + "'<domain>:name=Stats,*' key must be of type PerformanceCounter.class",
                       valueofMaxProcessingTime);
-        assertTrue(valueofMaxProcessingTime > 0);
+        assertTrue(valueofMaxProcessingTime >= 0);
         Long valueofMeanProcessingTime = (Long)mbs.getAttribute(pcob, "MeanProcessingTime");
         assertNotNull("Expected attribute not found. MBean registerred under a "
                       + "'<domain>:name=Stats,*' key must be of type PerformanceCounter.class",



Mime
View raw message