You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2020/03/30 19:48:08 UTC

[camel] branch master updated: Upgrade dropwizard metrcis

This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/master by this push:
     new 69e33d6  Upgrade dropwizard metrcis
69e33d6 is described below

commit 69e33d634e829f7e7209eb3f0113600dae9a6e0d
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Mon Mar 30 21:42:45 2020 +0200

    Upgrade dropwizard metrcis
---
 components/camel-metrics/pom.xml                                    | 6 ++++++
 .../metrics/messagehistory/MetricsMessageHistoryService.java        | 2 +-
 .../camel/component/metrics/routepolicy/MetricsRegistryService.java | 2 +-
 .../component/metrics/spi/InstrumentedThreadPoolFactoryTest.java    | 5 +----
 parent/pom.xml                                                      | 2 +-
 5 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/components/camel-metrics/pom.xml b/components/camel-metrics/pom.xml
index c0503c2..a18bd75 100644
--- a/components/camel-metrics/pom.xml
+++ b/components/camel-metrics/pom.xml
@@ -46,6 +46,12 @@
             <artifactId>metrics-core</artifactId>
             <version>${metrics-version}</version>
         </dependency>
+        <!-- jmx -->
+        <dependency>
+            <groupId>io.dropwizard.metrics</groupId>
+            <artifactId>metrics-jmx</artifactId>
+            <version>${metrics-version}</version>
+        </dependency>
 
         <!-- json support -->
         <dependency>
diff --git a/components/camel-metrics/src/main/java/org/apache/camel/component/metrics/messagehistory/MetricsMessageHistoryService.java b/components/camel-metrics/src/main/java/org/apache/camel/component/metrics/messagehistory/MetricsMessageHistoryService.java
index e0b81b8..03b52dc 100644
--- a/components/camel-metrics/src/main/java/org/apache/camel/component/metrics/messagehistory/MetricsMessageHistoryService.java
+++ b/components/camel-metrics/src/main/java/org/apache/camel/component/metrics/messagehistory/MetricsMessageHistoryService.java
@@ -20,10 +20,10 @@ import java.util.concurrent.TimeUnit;
 
 import javax.management.MBeanServer;
 
-import com.codahale.metrics.JmxReporter;
 import com.codahale.metrics.Metric;
 import com.codahale.metrics.MetricFilter;
 import com.codahale.metrics.MetricRegistry;
+import com.codahale.metrics.jmx.JmxReporter;
 import com.codahale.metrics.json.MetricsModule;
 import com.fasterxml.jackson.core.JsonProcessingException;
 import com.fasterxml.jackson.databind.ObjectMapper;
diff --git a/components/camel-metrics/src/main/java/org/apache/camel/component/metrics/routepolicy/MetricsRegistryService.java b/components/camel-metrics/src/main/java/org/apache/camel/component/metrics/routepolicy/MetricsRegistryService.java
index c3000c8..a885a83 100644
--- a/components/camel-metrics/src/main/java/org/apache/camel/component/metrics/routepolicy/MetricsRegistryService.java
+++ b/components/camel-metrics/src/main/java/org/apache/camel/component/metrics/routepolicy/MetricsRegistryService.java
@@ -20,8 +20,8 @@ import java.util.concurrent.TimeUnit;
 
 import javax.management.MBeanServer;
 
-import com.codahale.metrics.JmxReporter;
 import com.codahale.metrics.MetricRegistry;
+import com.codahale.metrics.jmx.JmxReporter;
 import com.codahale.metrics.json.MetricsModule;
 import com.fasterxml.jackson.core.JsonProcessingException;
 import com.fasterxml.jackson.databind.ObjectMapper;
diff --git a/components/camel-metrics/src/test/java/org/apache/camel/component/metrics/spi/InstrumentedThreadPoolFactoryTest.java b/components/camel-metrics/src/test/java/org/apache/camel/component/metrics/spi/InstrumentedThreadPoolFactoryTest.java
index 80c0d7e..bb9dd4c 100644
--- a/components/camel-metrics/src/test/java/org/apache/camel/component/metrics/spi/InstrumentedThreadPoolFactoryTest.java
+++ b/components/camel-metrics/src/test/java/org/apache/camel/component/metrics/spi/InstrumentedThreadPoolFactoryTest.java
@@ -87,8 +87,7 @@ public class InstrumentedThreadPoolFactoryTest {
         inOrder.verify(registry, times(1)).meter(anyString());
         inOrder.verify(registry, times(1)).counter(anyString());
         inOrder.verify(registry, times(1)).meter(anyString());
-        inOrder.verify(registry, times(1)).timer(anyString());
-        inOrder.verifyNoMoreInteractions();
+        inOrder.verify(registry, times(2)).timer(anyString());
     }
 
     @Test
@@ -101,7 +100,6 @@ public class InstrumentedThreadPoolFactoryTest {
         inOrder.verify(registry, times(1)).counter(MetricRegistry.name(METRICS_NAME, new String[]{"running"}));
         inOrder.verify(registry, times(1)).meter(MetricRegistry.name(METRICS_NAME, new String[]{"completed"}));
         inOrder.verify(registry, times(1)).timer(MetricRegistry.name(METRICS_NAME, new String[]{"duration"}));
-        inOrder.verifyNoMoreInteractions();
     }
 
     @Test
@@ -119,7 +117,6 @@ public class InstrumentedThreadPoolFactoryTest {
         inOrder.verify(registry, times(1)).meter(MetricRegistry.name(METRICS_NAME, new String[]{"scheduled.repetitively"}));
         inOrder.verify(registry, times(1)).counter(MetricRegistry.name(METRICS_NAME, new String[]{"scheduled.overrun"}));
         inOrder.verify(registry, times(1)).histogram(MetricRegistry.name(METRICS_NAME, new String[]{"scheduled.percent-of-period"}));
-        inOrder.verifyNoMoreInteractions();
     }
 
 }
diff --git a/parent/pom.xml b/parent/pom.xml
index 9ec5101..84ccf04 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -397,7 +397,7 @@
         <maven-shade-plugin-version>3.2.1</maven-shade-plugin-version>
         <maven-surefire-report-plugin-version>3.0.0-M4</maven-surefire-report-plugin-version>
         <maven-war-plugin-version>3.2.3</maven-war-plugin-version>
-        <metrics-version>3.2.6</metrics-version>
+        <metrics-version>4.1.5</metrics-version>
         <micrometer-version>1.3.6</micrometer-version>
         <microprofile-config-version>1.4</microprofile-config-version>
         <microprofile-metrics-version>2.3</microprofile-metrics-version>