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/4ebb646f Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/4ebb646f Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/4ebb646f Branch: refs/heads/camel-2.11.x Commit: 4ebb646f3c1142b8a552c790057f397c5012dbe2 Parents: 6675087 Author: Claus Ibsen <davscl...@apache.org> Authored: Sun Jun 2 18:03:04 2013 +0200 Committer: Claus Ibsen <davscl...@apache.org> Committed: Sun Jun 2 18:03:33 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/4ebb646f/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 {