public class AggregatingMessageHandlerMetrics extends DefaultMessageHandlerMetrics
MessageHandlerMetrics
that aggregates the total response
time over a sample, to avoid fetching the system time twice for every message.| Modifier and Type | Class and Description |
|---|---|
protected static class |
AggregatingMessageHandlerMetrics.AggregatingHandlerMetricsContext |
DefaultMessageHandlerMetrics.DefaultHandlerMetricsContextactiveCount, duration, errorCount, handleCountlogger, name| Constructor and Description |
|---|
AggregatingMessageHandlerMetrics() |
AggregatingMessageHandlerMetrics(String name,
ExponentialMovingAverage duration,
int sampleSize)
Construct an instance with the supplied
ExponentialMovingAverage calculating
the duration of processing by the message handler (and any downstream synchronous
endpoints). |
AggregatingMessageHandlerMetrics(String name,
int sampleSize)
Construct an instance with the default moving average window (10).
|
| Modifier and Type | Method and Description |
|---|---|
void |
afterHandle(MetricsContext context,
boolean success)
End a handle event
|
MetricsContext |
beforeHandle()
Begin a handle event.
|
getActiveCount, getActiveCountLong, getDuration, getErrorCount, getErrorCountLong, getHandleCount, getHandleCountLong, getMaxDuration, getMeanDuration, getMinDuration, getStandardDeviationDuration, resetisFullStatsEnabled, setFullStatsEnabledpublic AggregatingMessageHandlerMetrics()
public AggregatingMessageHandlerMetrics(String name, int sampleSize)
name - the name.sampleSize - the sample size over which to aggregate the duration.public AggregatingMessageHandlerMetrics(String name, ExponentialMovingAverage duration, int sampleSize)
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.sampleSize - the sample size over which to aggregate the duration.public MetricsContext beforeHandle()
AbstractMessageHandlerMetricsbeforeHandle in class DefaultMessageHandlerMetricsAbstractMessageHandlerMetrics.afterHandle(MetricsContext, boolean).public void afterHandle(MetricsContext context, boolean success)
AbstractMessageHandlerMetricsafterHandle in class DefaultMessageHandlerMetricscontext - the context from the previous AbstractMessageHandlerMetrics.beforeHandle().success - true for success, false otherwise.