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.NonManagedService
A
RoutePolicy which gathers statistics and reports them using
MetricRegistry.
The metrics is reported in JMX by default, but this can be configured.-
Field Summary
FieldsFields inherited from class org.apache.camel.support.service.BaseService
BUILT, FAILED, INITIALIZED, INITIALIZING, lock, NEW, SHUTDOWN, SHUTTING_DOWN, STARTED, STARTING, status, STOPPED, STOPPING, SUSPENDED, SUSPENDING -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncom.codahale.metrics.MetricRegistrybooleanbooleanisUseJmx()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, getExceptionHandler, handleException, onRemove, onResume, onStart, onStop, onSuspend, resumeOrStartConsumer, resumeRoute, setExceptionHandler, startConsumer, startRoute, stopConsumer, stopRoute, stopRoute, stopRouteAsync, suspendOrStopConsumer, suspendRoute, suspendRouteMethods inherited from class org.apache.camel.support.service.BaseService
build, doBuild, doFail, doInit, doLifecycleChange, doResume, doShutdown, doStart, doStop, doSuspend, fail, getStatus, init, isBuild, isInit, isNew, isRunAllowed, isShutdown, isStarted, isStarting, isStartingOrStarted, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, isSuspendingOrSuspended, resume, shutdown, start, stop, suspendMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.camel.Service
build, close, init, start, stopMethods inherited from interface org.apache.camel.ShutdownableService
shutdownMethods inherited from interface org.apache.camel.StatefulService
getStatus, isRunAllowed, isStarted, isStarting, isStopped, isStopping, isSuspendingMethods inherited from interface org.apache.camel.SuspendableService
isSuspended, resume, suspend
-
Field Details
-
NAME_TOKEN
- See Also:
-
ROUTE_ID_TOKEN
- See Also:
-
TYPE_TOKEN
- See Also:
-
-
Constructor Details
-
MetricsRoutePolicy
public MetricsRoutePolicy()
-
-
Method Details
-
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
-
setJmxDomain
-
isPrettyPrint
public boolean isPrettyPrint() -
setPrettyPrint
public void setPrettyPrint(boolean prettyPrint) -
getRateUnit
-
setRateUnit
-
getDurationUnit
-
setDurationUnit
-
getNamePattern
-
setNamePattern
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
-