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 2013/06/03 08:20:23 UTC

[5/8] git commit: CAMEL-6324: Show type converter utilization in karaf camel info command if enabled.

CAMEL-6324: Show type converter utilization in karaf camel info command if enabled.


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

Branch: refs/heads/master
Commit: fe3ceaecd81b1173d58eb2d0ed7046748d45ae92
Parents: 244caea
Author: Claus Ibsen <da...@apache.org>
Authored: Sun Jun 2 18:03:04 2013 +0200
Committer: Claus Ibsen <da...@apache.org>
Committed: Sun Jun 2 18:03:04 2013 +0200

----------------------------------------------------------------------
 .../apache/camel/karaf/commands/ContextInfo.java   |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/fe3ceaec/platforms/karaf/commands/src/main/java/org/apache/camel/karaf/commands/ContextInfo.java
----------------------------------------------------------------------
diff --git a/platforms/karaf/commands/src/main/java/org/apache/camel/karaf/commands/ContextInfo.java b/platforms/karaf/commands/src/main/java/org/apache/camel/karaf/commands/ContextInfo.java
index b93f4da..23c0579 100644
--- a/platforms/karaf/commands/src/main/java/org/apache/camel/karaf/commands/ContextInfo.java
+++ b/platforms/karaf/commands/src/main/java/org/apache/camel/karaf/commands/ContextInfo.java
@@ -135,6 +135,15 @@ public class ContextInfo extends OsgiCommandSupport {
                     System.out.println(StringEscapeUtils.unescapeJava("\tLast Exchange Completed Date: " + format.format(lastExchangeCompletedTimestamp)));
                 }
 
+                // add type converter statistics if enabled
+                if (camelContext.getTypeConverterRegistry().getStatistics().isStatisticsEnabled()) {
+                    System.out.println(StringEscapeUtils.unescapeJava(String.format("\tTypeConverterRegistry utilization: [attempts=%s, hits=%s, misses=%s, failures=%s]",
+                            camelContext.getTypeConverterRegistry().getStatistics().getAttemptCounter(),
+                            camelContext.getTypeConverterRegistry().getStatistics().getHitCounter(),
+                            camelContext.getTypeConverterRegistry().getStatistics().getMissCounter(),
+                            camelContext.getTypeConverterRegistry().getStatistics().getFailedCounter())));
+                }
+
                 long activeRoutes = 0;
                 long inactiveRoutes = 0;
                 List<Route> routeList = camelContext.getRoutes();
@@ -148,7 +157,6 @@ public class ContextInfo extends OsgiCommandSupport {
 
                 System.out.println(StringEscapeUtils.unescapeJava("\tNumber of running routes: " + activeRoutes));
                 System.out.println(StringEscapeUtils.unescapeJava("\tNumber of not running routes: " + inactiveRoutes));
-
             }
 
         } else {