camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject [2/2] camel git commit: CAMEL-11364: Runtime endpoint registry - Do not use extended mode as default
Date Tue, 30 May 2017 09:19:43 GMT
CAMEL-11364: Runtime endpoint registry - Do not use extended mode as default


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/301ecfee
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/301ecfee
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/301ecfee

Branch: refs/heads/master
Commit: 301ecfee34b1f73221e926cff7bc7c722b27c2ec
Parents: 3cf7e33
Author: Claus Ibsen <davsclaus@apache.org>
Authored: Tue May 30 11:17:26 2017 +0200
Committer: Claus Ibsen <davsclaus@apache.org>
Committed: Tue May 30 11:19:24 2017 +0200

----------------------------------------------------------------------
 .../apache/camel/impl/DefaultRuntimeEndpointRegistry.java |  5 +----
 .../main/java/org/apache/camel/spi/ManagementAgent.java   |  2 +-
 .../ManagedEndpointUtilizationStatisticsTest.java         | 10 ++++++++++
 3 files changed, 12 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/301ecfee/camel-core/src/main/java/org/apache/camel/impl/DefaultRuntimeEndpointRegistry.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/impl/DefaultRuntimeEndpointRegistry.java
b/camel-core/src/main/java/org/apache/camel/impl/DefaultRuntimeEndpointRegistry.java
index 4858f48..0008c66 100644
--- a/camel-core/src/main/java/org/apache/camel/impl/DefaultRuntimeEndpointRegistry.java
+++ b/camel-core/src/main/java/org/apache/camel/impl/DefaultRuntimeEndpointRegistry.java
@@ -190,10 +190,7 @@ public class DefaultRuntimeEndpointRegistry extends EventNotifierSupport
impleme
             outputs = new HashMap<String, Map<String, String>>();
         }
         if (getCamelContext().getManagementStrategy().getManagementAgent() != null) {
-            Boolean isEnabled = getCamelContext().getManagementStrategy().getManagementAgent().getEndpointRuntimeStatisticsEnabled();
-            boolean isExtended = getCamelContext().getManagementStrategy().getManagementAgent().getStatisticsLevel().isExtended();
-            // extended mode is either if we use Extended statistics level or the option
is explicit enabled
-            extended = isExtended || isEnabled != null && isEnabled;
+            extended = getCamelContext().getManagementStrategy().getManagementAgent().getStatisticsLevel().isExtended();
         }
         if (extended) {
             inputUtilization = new DefaultEndpointUtilizationStatistics(limit);

http://git-wip-us.apache.org/repos/asf/camel/blob/301ecfee/camel-core/src/main/java/org/apache/camel/spi/ManagementAgent.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/spi/ManagementAgent.java b/camel-core/src/main/java/org/apache/camel/spi/ManagementAgent.java
index b208c8d..36eec1e 100644
--- a/camel-core/src/main/java/org/apache/camel/spi/ManagementAgent.java
+++ b/camel-core/src/main/java/org/apache/camel/spi/ManagementAgent.java
@@ -328,7 +328,7 @@ public interface ManagementAgent extends Service {
     void setEndpointRuntimeStatisticsEnabled(Boolean flag);
 
     /**
-     * Gets whether load statistics is enabled
+     * Gets whether endpoint runtime statistics is enabled
      *
      * @return <tt>true</tt> if enabled
      */

http://git-wip-us.apache.org/repos/asf/camel/blob/301ecfee/camel-core/src/test/java/org/apache/camel/management/ManagedEndpointUtilizationStatisticsTest.java
----------------------------------------------------------------------
diff --git a/camel-core/src/test/java/org/apache/camel/management/ManagedEndpointUtilizationStatisticsTest.java
b/camel-core/src/test/java/org/apache/camel/management/ManagedEndpointUtilizationStatisticsTest.java
index 49188ee..ea68d91 100644
--- a/camel-core/src/test/java/org/apache/camel/management/ManagedEndpointUtilizationStatisticsTest.java
+++ b/camel-core/src/test/java/org/apache/camel/management/ManagedEndpointUtilizationStatisticsTest.java
@@ -18,6 +18,8 @@ package org.apache.camel.management;
 
 import java.util.List;
 
+import org.apache.camel.CamelContext;
+import org.apache.camel.ManagementStatisticsLevel;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.spi.RuntimeEndpointRegistry;
 
@@ -26,6 +28,14 @@ import org.apache.camel.spi.RuntimeEndpointRegistry;
  */
 public class ManagedEndpointUtilizationStatisticsTest extends ManagementTestSupport {
 
+    @Override
+    protected CamelContext createCamelContext() throws Exception {
+        CamelContext camelContext = super.createCamelContext();
+        // turn on extended mode
+        camelContext.getManagementStrategy().getManagementAgent().setStatisticsLevel(ManagementStatisticsLevel.Extended);
+        return camelContext;
+    }
+
     public void testManageEndpointUtilizationStatistics() throws Exception {
         // JMX tests dont work well on AIX CI servers (hangs them)
         if (isPlatform("aix")) {


Mime
View raw message