[CONF] Apache Camel Metrics Component

2014-08-30 Thread Claus Ibsen (Confluence)














  


Claus Ibsen edited the page:
 


Metrics Component   






...
Themetrics:component allows to collect various metrics directly from Camel routes. Supported metric types arecounter,histogram, meterandtimer.Metricsprovides simple way to measure behaviour of application. Configurable reportingbackendis enabling different integration options for collecting and visualizing statistics. The component also provides aMetricsRoutePolicyFactory which allows to expose route statistics using codehale metrics, see bottom of page for details.
...
Each metric has type and name. Supported types are counter, histogram,meterand timer. Metric name is simple string. If metric type is not provided then type meter is used by default.
...




Name
Default
Description


useJmx
false
Whether to report fine grained statistics to JMX by using the com.codahale.metrics.JmxReporter.Notice that if JMX is enabled on CamelContext then a MetricsRegistryService mbean is enlisted under the services type in the JMX tree. That mbean has a single operation to output the statistics using json. Setting useJmx to true is only needed if you want fine grained mbeans per statistics type.


jmxDomain
org.apache.camel.metrics
The JMX domain name


prettyPrint
false
Whether to use pretty print when outputting statistics in json format


metricsRegistry

Allow to use a shared com.codahale.metrics.MetricRegistry. If none is provided then Camel will create a shared instance used by the this CamelContext.


rateUnit
TimeUnit.SECONDS
The unit to use for rate in the metrics reporter or when dumping the statistics as json.

[CONF] Apache Camel Metrics Component

2014-08-17 Thread Claus Ibsen (Confluence)














  


Claus Ibsen edited the page:
 


Metrics Component   






...
Themetrics:component allows to collect various metrics directly from Camel routes. Supported metric types arecounter,histogram, meterandtimer.Metricsprovides simple way to measure behaviour of application. Configurable reportingbackendis enabling different integration options for collecting and visualizing statistics. The component also provides aMetricsRoutePolicyFactory which allows to expose route statistics using codehale metrics, see bottom of page for details.
...
Each metric has type and name. Supported types are counter, histogram,meterand timer. Metric name is simple string. If metric type is not provided then type meter is used by default.
...




Name
Default
Description


useJmx
true
Whether to report the fine grained statistics to JMX by using the com.codahale.metrics.JmxReporter


jmxDomain
org.apache.camel.metrics
The JMX domain name


prettyPrint
false
Whether to use pretty print when outputting statistics in json format


metricsRegistry

Allow to use a shared com.codahale.metrics.MetricRegistry. If none is provided then Camel will create a shared instance used by the this CamelContext.




...






 View Online   Like   View Changes  
 Stop watching space   Manage Notifications  
  

[CONF] Apache Camel Metrics Component

2014-08-17 Thread Claus Ibsen (Confluence)














  


Claus Ibsen edited the page:
 


Metrics Component   






...
Themetrics:component allows to collect various metrics directly from Camel routes. Supported metric types arecounter,histogram, meterandtimer.Metricsprovides simple way to measure behaviour of application. Configurable reportingbackendis enabling different integration options for collecting and visualizing statistics. The component also provides aMetricsRoutePolicyFactory which allows to expose route statistics using codehale metrics, see bottom of page for details.
...
Each metric has type and name. Supported types are counter, histogram,meterand timer. Metric name is simple string. If metric type is not provided then type meter is used by default.
...




Name
Default
Description


useJmx
truefalse
Whether to report fine grained statistics to JMX by using the com.codahale.metrics.JmxReporter.  Notice that if JMX is enabled on CamelContext then a MetricsRegistryService mbean is enlisted under the services type in the JMX tree. That mbean has a single operation to output the statistics using json. Setting useJmx to true is only needed if you want fine grained mbeans per statistics type.


jmxDomain
org.apache.camel.metrics
The JMX domain name


prettyPrint
false
Whether to use pretty print when outputting statistics in json format


metricsRegistry

Allow to use a shared com.codahale.metrics.MetricRegistry. If none is provided then Camel will create a shared instance used by the this CamelContext.




...




[CONF] Apache Camel Metrics Component

2014-08-13 Thread Lauri Kimmel (Confluence)














  


Lauri Kimmel created a page:
 


Metrics Component   





Metrics Component
 Available as of Camel 2.14 
Themetrics:component allows you to collect various metrics directly from Camel routes. Supported metric types arecounter,histogram, meterandtimer.Metricsprovides simple way to measure behaviour of your application. Configurable reportingbackendis enabling different integration options for collecting and visualizing statistics.
Maven users will need to add the following dependency to their pom.xml for this component:


dependency
groupIdorg.apache.camel/groupId
artifactIdcamel-metrics/artifactId
versionx.x.x/version
!-- use the same version as your Camel core version --
/dependency


URI format


metrics:[ meter | counter | histogram | timer ]:metricname[?options]


 Metric Registry 
Camel Metrics Component uses by default MetricRegistry with Slf4jReporter and 60 second reporting interval. Default registry can be replaced with custom one by providing bean with name metricRegistry in Camel registry.For example using Spring Java Configuration. 


@Configuration
public static class MyConfig extends SingleRouteCamelConfiguration {

@Bean
@Override
public RouteBuilder route() {
return new RouteBuilder() {
@Override
public void configure() throws Exception {
// define Camel routes here
}
};
}

@Bean(name = MetricsComponent.METRIC_REGISTRY_NAME)
public MetricRegistry getMetricRegistry() {
MetricRegistry registry = ...;
return registry;
}
}



Icon

 MetricRegistry uses internal thread(s) for reporting. There is no public API in version 3.0.1 for users to clean up on exit. Thus using Camel Metrics Component leads to Java classloader leak and my cause OutOfMemoryErrors in some cases.


Usage
Each metric has type and name. Supported types are counter, histogram,meterand timer. Metric name is simple string. If metric type is not provided then type meter is used by default.
Headers
Metric name defined in URI can be overridden by using header with name CamelMetricsName.
For example


from(direct:in)
.setHeader(MetricsConstants.HEADER_METRIC_NAME, 

[CONF] Apache Camel Metrics Component

2014-08-13 Thread Lauri Kimmel (Confluence)














  


Lauri Kimmel edited the page:
 


Metrics Component   






...
Themetrics:component allows you to collect various metrics directly from Camel routes. Supported metric types arecounter,histogram, meterandtimer.Metricsprovides simple way to measure behaviour of your application. Configurable reportingbackendis enabling different integration options for collecting and visualizing statistics.
...
Each metric has type and name. Supported types are counter, histogram,meterand timer. Metric name is simple string. If metric type is not provided then type meter is used by default.
...






 View Online   Like   View Changes  
 Stop watching space   Manage Notifications  


 


 


  This message was sent by Atlassian Confluence 5.0.3, Team Collaboration Software  






[CONF] Apache Camel Metrics Component

2014-08-13 Thread Lauri Kimmel (Confluence)














  


Lauri Kimmel edited the page:
 


Metrics Component   






...
Themetrics:component allows to collect various metrics directly from Camel routes. Supported metric types arecounter,histogram, meterandtimer.Metricsprovides simple way to measure behaviour of your application. Configurable reportingbackendis enabling different integration options for collecting and visualizing statistics.
...
Each metric has type and name. Supported types are counter, histogram,meterand timer. Metric name is simple string. If metric type is not provided then type meter is used by default.
...






 View Online   Like   View Changes  
 Stop watching space   Manage Notifications  


 


 


  This message was sent by Atlassian Confluence 5.0.3, Team Collaboration Software