public class MetricsRoutePolicy
extends org.apache.camel.support.RoutePolicySupport
implements org.apache.camel.NonManagedService
RoutePolicy
which gathers statistics and reports them using MetricRegistry
.
The metrics is reported in JMX by default, but this can be configured.Constructor and Description |
---|
MetricsRoutePolicy() |
Modifier and Type | Method and Description |
---|---|
TimeUnit |
getDurationUnit() |
String |
getJmxDomain() |
com.codahale.metrics.MetricRegistry |
getMetricsRegistry() |
String |
getNamePattern() |
TimeUnit |
getRateUnit() |
boolean |
isPrettyPrint() |
boolean |
isUseJmx() |
void |
onExchangeBegin(org.apache.camel.Route route,
org.apache.camel.Exchange exchange) |
void |
onExchangeDone(org.apache.camel.Route route,
org.apache.camel.Exchange exchange) |
void |
onInit(org.apache.camel.Route route) |
void |
setDurationUnit(TimeUnit durationUnit) |
void |
setJmxDomain(String jmxDomain) |
void |
setMetricsRegistry(com.codahale.metrics.MetricRegistry metricsRegistry) |
void |
setNamePattern(String namePattern)
The name pattern to use.
|
void |
setPrettyPrint(boolean prettyPrint) |
void |
setRateUnit(TimeUnit rateUnit) |
void |
setUseJmx(boolean useJmx) |
doStart, doStop, getExceptionHandler, handleException, onRemove, onResume, onStart, onStop, onSuspend, resumeRoute, setExceptionHandler, startConsumer, startRoute, stopConsumer, stopRoute, stopRoute, suspendRoute, suspendRoute
public com.codahale.metrics.MetricRegistry getMetricsRegistry()
public void setMetricsRegistry(com.codahale.metrics.MetricRegistry metricsRegistry)
public boolean isUseJmx()
public void setUseJmx(boolean useJmx)
public String getJmxDomain()
public void setJmxDomain(String jmxDomain)
public boolean isPrettyPrint()
public void setPrettyPrint(boolean prettyPrint)
public TimeUnit getRateUnit()
public void setRateUnit(TimeUnit rateUnit)
public TimeUnit getDurationUnit()
public void setDurationUnit(TimeUnit durationUnit)
public String getNamePattern()
public void setNamePattern(String namePattern)
public void onInit(org.apache.camel.Route route)
onInit
in interface org.apache.camel.spi.RoutePolicy
onInit
in class org.apache.camel.support.RoutePolicySupport
public void onExchangeBegin(org.apache.camel.Route route, org.apache.camel.Exchange exchange)
onExchangeBegin
in interface org.apache.camel.spi.RoutePolicy
onExchangeBegin
in class org.apache.camel.support.RoutePolicySupport
public void onExchangeDone(org.apache.camel.Route route, org.apache.camel.Exchange exchange)
onExchangeDone
in interface org.apache.camel.spi.RoutePolicy
onExchangeDone
in class org.apache.camel.support.RoutePolicySupport
Apache Camel