Class MetricsRoutePolicy
- java.lang.Object
-
- org.apache.camel.support.service.BaseService
-
- org.apache.camel.support.service.ServiceSupport
-
- org.apache.camel.support.RoutePolicySupport
-
- org.apache.camel.component.metrics.routepolicy.MetricsRoutePolicy
-
- All Implemented Interfaces:
AutoCloseable,org.apache.camel.NonManagedService,org.apache.camel.Service,org.apache.camel.ShutdownableService,org.apache.camel.spi.RoutePolicy,org.apache.camel.StatefulService,org.apache.camel.SuspendableService
public class MetricsRoutePolicy extends org.apache.camel.support.RoutePolicySupport implements org.apache.camel.NonManagedServiceARoutePolicywhich gathers statistics and reports them usingMetricRegistry. The metrics is reported in JMX by default, but this can be configured.
-
-
Field Summary
Fields Modifier and Type Field Description static StringNAME_TOKENstatic StringROUTE_ID_TOKENstatic StringTYPE_TOKEN
-
Constructor Summary
Constructors Constructor Description MetricsRoutePolicy()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TimeUnitgetDurationUnit()StringgetJmxDomain()com.codahale.metrics.MetricRegistrygetMetricsRegistry()StringgetNamePattern()TimeUnitgetRateUnit()booleanisPrettyPrint()booleanisUseJmx()voidonExchangeBegin(org.apache.camel.Route route, org.apache.camel.Exchange exchange)voidonExchangeDone(org.apache.camel.Route route, org.apache.camel.Exchange exchange)voidonInit(org.apache.camel.Route route)voidsetDurationUnit(TimeUnit durationUnit)voidsetJmxDomain(String jmxDomain)voidsetMetricsRegistry(com.codahale.metrics.MetricRegistry metricsRegistry)voidsetNamePattern(String namePattern)The name pattern to use.voidsetPrettyPrint(boolean prettyPrint)voidsetRateUnit(TimeUnit rateUnit)voidsetUseJmx(boolean useJmx)-
Methods inherited from class org.apache.camel.support.RoutePolicySupport
controller, doStart, doStop, getExceptionHandler, handleException, onRemove, onResume, onStart, onStop, onSuspend, resumeOrStartConsumer, resumeRoute, setExceptionHandler, startConsumer, startRoute, stopConsumer, stopRoute, stopRoute, stopRouteAsync, suspendOrStopConsumer, suspendRoute, suspendRoute
-
Methods inherited from class org.apache.camel.support.service.BaseService
build, doBuild, doFail, doInit, doLifecycleChange, doResume, doShutdown, doSuspend, fail, getStatus, init, isBuild, isInit, isNew, isRunAllowed, isShutdown, isStarted, isStarting, isStartingOrStarted, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, isSuspendingOrSuspended, resume, shutdown, start, stop, suspend
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
-
-
Field Detail
-
NAME_TOKEN
public static final String NAME_TOKEN
- See Also:
- Constant Field Values
-
ROUTE_ID_TOKEN
public static final String ROUTE_ID_TOKEN
- See Also:
- Constant Field Values
-
TYPE_TOKEN
public static final String TYPE_TOKEN
- See Also:
- Constant Field Values
-
-
Method Detail
-
getMetricsRegistry
public com.codahale.metrics.MetricRegistry getMetricsRegistry()
-
setMetricsRegistry
public void setMetricsRegistry(com.codahale.metrics.MetricRegistry metricsRegistry)
-
isUseJmx
public boolean isUseJmx()
-
setUseJmx
public void setUseJmx(boolean useJmx)
-
getJmxDomain
public String getJmxDomain()
-
setJmxDomain
public void setJmxDomain(String jmxDomain)
-
isPrettyPrint
public boolean isPrettyPrint()
-
setPrettyPrint
public void setPrettyPrint(boolean prettyPrint)
-
getRateUnit
public TimeUnit getRateUnit()
-
setRateUnit
public void setRateUnit(TimeUnit rateUnit)
-
getDurationUnit
public TimeUnit getDurationUnit()
-
setDurationUnit
public void setDurationUnit(TimeUnit durationUnit)
-
getNamePattern
public String getNamePattern()
-
setNamePattern
public void setNamePattern(String namePattern)
The name pattern to use. Uses dot as separators, but you can change that. The values ##name##, ##routeId##, and ##type## will be replaced with actual value.
-
onInit
public void onInit(org.apache.camel.Route route)
- Specified by:
onInitin interfaceorg.apache.camel.spi.RoutePolicy- Overrides:
onInitin classorg.apache.camel.support.RoutePolicySupport
-
onExchangeBegin
public void onExchangeBegin(org.apache.camel.Route route, org.apache.camel.Exchange exchange)- Specified by:
onExchangeBeginin interfaceorg.apache.camel.spi.RoutePolicy- Overrides:
onExchangeBeginin classorg.apache.camel.support.RoutePolicySupport
-
onExchangeDone
public void onExchangeDone(org.apache.camel.Route route, org.apache.camel.Exchange exchange)- Specified by:
onExchangeDonein interfaceorg.apache.camel.spi.RoutePolicy- Overrides:
onExchangeDonein classorg.apache.camel.support.RoutePolicySupport
-
-