public class DefaultMessageHandlerMetrics extends AbstractMessageHandlerMetrics
| Modifier and Type | Class and Description |
|---|---|
protected static class |
DefaultMessageHandlerMetrics.DefaultHandlerMetricsContext |
| Modifier and Type | Field and Description |
|---|---|
protected java.util.concurrent.atomic.AtomicLong |
activeCount |
protected ExponentialMovingAverage |
duration |
protected java.util.concurrent.atomic.AtomicLong |
errorCount |
protected java.util.concurrent.atomic.AtomicLong |
handleCount |
logger, name| Constructor and Description |
|---|
DefaultMessageHandlerMetrics() |
DefaultMessageHandlerMetrics(java.lang.String name)
Construct an instance with the default moving average window (10).
|
DefaultMessageHandlerMetrics(java.lang.String name,
ExponentialMovingAverage duration)
Construct an instance with the supplied
ExponentialMovingAverage calculating
the duration of processing by the message handler (and any downstream synchronous
endpoints). |
| Modifier and Type | Method and Description |
|---|---|
void |
afterHandle(MetricsContext context,
boolean success)
End a handle event
|
MetricsContext |
beforeHandle()
Begin a handle event.
|
int |
getActiveCount() |
long |
getActiveCountLong() |
Statistics |
getDuration() |
int |
getErrorCount() |
long |
getErrorCountLong() |
int |
getHandleCount() |
long |
getHandleCountLong() |
double |
getMaxDuration() |
double |
getMeanDuration() |
double |
getMinDuration() |
double |
getStandardDeviationDuration() |
void |
reset() |
isFullStatsEnabled, setFullStatsEnabledprotected final java.util.concurrent.atomic.AtomicLong activeCount
protected final java.util.concurrent.atomic.AtomicLong handleCount
protected final java.util.concurrent.atomic.AtomicLong errorCount
protected final ExponentialMovingAverage duration
public DefaultMessageHandlerMetrics()
public DefaultMessageHandlerMetrics(java.lang.String name)
name - the name.public DefaultMessageHandlerMetrics(java.lang.String name,
ExponentialMovingAverage duration)
ExponentialMovingAverage calculating
the duration of processing by the message handler (and any downstream synchronous
endpoints).name - the name.duration - an ExponentialMovingAverage for calculating the duration.public MetricsContext beforeHandle()
AbstractMessageHandlerMetricsbeforeHandle in class AbstractMessageHandlerMetricsAbstractMessageHandlerMetrics.afterHandle(MetricsContext, boolean).public void afterHandle(MetricsContext context, boolean success)
AbstractMessageHandlerMetricsafterHandle in class AbstractMessageHandlerMetricscontext - the context from the previous AbstractMessageHandlerMetrics.beforeHandle().success - true for success, false otherwise.public void reset()
reset in class AbstractMessageHandlerMetricspublic long getHandleCountLong()
getHandleCountLong in class AbstractMessageHandlerMetricspublic int getHandleCount()
getHandleCount in class AbstractMessageHandlerMetricspublic int getErrorCount()
getErrorCount in class AbstractMessageHandlerMetricspublic long getErrorCountLong()
getErrorCountLong in class AbstractMessageHandlerMetricspublic double getMeanDuration()
getMeanDuration in class AbstractMessageHandlerMetricspublic double getMinDuration()
getMinDuration in class AbstractMessageHandlerMetricspublic double getMaxDuration()
getMaxDuration in class AbstractMessageHandlerMetricspublic double getStandardDeviationDuration()
getStandardDeviationDuration in class AbstractMessageHandlerMetricspublic int getActiveCount()
getActiveCount in class AbstractMessageHandlerMetricspublic long getActiveCountLong()
getActiveCountLong in class AbstractMessageHandlerMetricspublic Statistics getDuration()
getDuration in class AbstractMessageHandlerMetrics