Class MetricsRoutePolicyFactory
java.lang.Object
org.apache.camel.component.metrics.routepolicy.MetricsRoutePolicyFactory
- All Implemented Interfaces:
org.apache.camel.spi.RoutePolicyFactory
public class MetricsRoutePolicyFactory
extends Object
implements org.apache.camel.spi.RoutePolicyFactory
A
RoutePolicyFactory
to plugin and use metrics for gathering route utilization
statistics-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.apache.camel.spi.RoutePolicy
createRoutePolicy
(org.apache.camel.CamelContext camelContext, String routeId, org.apache.camel.NamedNode routeDefinition) com.codahale.metrics.MetricRegistry
boolean
boolean
isUseJmx()
void
setDurationUnit
(TimeUnit durationUnit) Sets the time unit to use for timing the duration of processing a message in the routevoid
setJmxDomain
(String jmxDomain) The JMX domain name to use for the enlisted JMX MBeans.void
setMetricsRegistry
(com.codahale.metrics.MetricRegistry metricsRegistry) To use a specificMetricRegistry
instance.void
setNamePattern
(String namePattern) void
setPrettyPrint
(boolean prettyPrint) Whether to use pretty print when outputting JSonvoid
setRateUnit
(TimeUnit rateUnit) Sets the time unit to use for requests per unit (eg requests per second)void
setUseJmx
(boolean useJmx) Whether to use JMX reported to enlist JMX MBeans with the metrics statistics.
-
Constructor Details
-
MetricsRoutePolicyFactory
public MetricsRoutePolicyFactory()
-
-
Method Details
-
setMetricsRegistry
public void setMetricsRegistry(com.codahale.metrics.MetricRegistry metricsRegistry) To use a specificMetricRegistry
instance. If no instance has been configured, then Camel will create a shared instance to be used. -
getMetricsRegistry
public com.codahale.metrics.MetricRegistry getMetricsRegistry() -
isUseJmx
public boolean isUseJmx() -
setUseJmx
public void setUseJmx(boolean useJmx) Whether to use JMX reported to enlist JMX MBeans with the metrics statistics. -
getJmxDomain
-
setJmxDomain
The JMX domain name to use for the enlisted JMX MBeans. -
isPrettyPrint
public boolean isPrettyPrint() -
setPrettyPrint
public void setPrettyPrint(boolean prettyPrint) Whether to use pretty print when outputting JSon -
getRateUnit
-
setRateUnit
Sets the time unit to use for requests per unit (eg requests per second) -
getDurationUnit
-
setDurationUnit
Sets the time unit to use for timing the duration of processing a message in the route -
getNamePattern
-
setNamePattern
-
createRoutePolicy
public org.apache.camel.spi.RoutePolicy createRoutePolicy(org.apache.camel.CamelContext camelContext, String routeId, org.apache.camel.NamedNode routeDefinition) - Specified by:
createRoutePolicy
in interfaceorg.apache.camel.spi.RoutePolicyFactory
-