public class DefaultMessageChannelMetrics extends AbstractMessageChannelMetrics
| Modifier and Type | Class and Description |
|---|---|
protected static class |
DefaultMessageChannelMetrics.DefaultChannelMetricsContext |
| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_MOVING_AVERAGE_WINDOW |
static long |
ONE_MINUTE_SECONDS |
static long |
ONE_SECOND_SECONDS |
protected AtomicLong |
receiveCount |
protected AtomicLong |
receiveErrorCount |
protected AtomicLong |
sendCount |
protected ExponentialMovingAverage |
sendDuration |
protected AtomicLong |
sendErrorCount |
protected ExponentialMovingAverageRate |
sendErrorRate |
protected ExponentialMovingAverageRate |
sendRate |
protected ExponentialMovingAverageRatio |
sendSuccessRatio |
logger, name| Constructor and Description |
|---|
DefaultMessageChannelMetrics() |
DefaultMessageChannelMetrics(String name)
Construct an instance with default metrics with
window=10, period=1 second,
lapsePeriod=1 minute. |
DefaultMessageChannelMetrics(String name,
ExponentialMovingAverage sendDuration,
ExponentialMovingAverageRate sendErrorRate,
ExponentialMovingAverageRatio sendSuccessRatio,
ExponentialMovingAverageRate sendRate)
Construct an instance with the supplied metrics.
|
| Modifier and Type | Method and Description |
|---|---|
void |
afterError() |
void |
afterReceive() |
void |
afterSend(MetricsContext context,
boolean result)
End a send event.
|
MetricsContext |
beforeSend()
Begin a send event.
|
void |
destroy() |
Statistics |
getErrorRate() |
double |
getMaxSendDuration() |
double |
getMeanErrorRate() |
double |
getMeanErrorRatio() |
double |
getMeanSendDuration() |
double |
getMeanSendRate() |
double |
getMinSendDuration() |
int |
getReceiveCount() |
long |
getReceiveCountLong() |
int |
getReceiveErrorCount() |
long |
getReceiveErrorCountLong() |
int |
getSendCount() |
long |
getSendCountLong() |
Statistics |
getSendDuration() |
int |
getSendErrorCount() |
long |
getSendErrorCountLong() |
Statistics |
getSendRate() |
double |
getStandardDeviationSendDuration() |
double |
getTimeSinceLastSend() |
void |
reset()
Reset all counters/statistics.
|
String |
toString() |
isFullStatsEnabled, setFullStatsEnabledpublic static final long ONE_SECOND_SECONDS
public static final long ONE_MINUTE_SECONDS
public static final int DEFAULT_MOVING_AVERAGE_WINDOW
protected final ExponentialMovingAverage sendDuration
protected final ExponentialMovingAverageRate sendErrorRate
protected final ExponentialMovingAverageRatio sendSuccessRatio
protected final ExponentialMovingAverageRate sendRate
protected final AtomicLong sendCount
protected final AtomicLong sendErrorCount
protected final AtomicLong receiveCount
protected final AtomicLong receiveErrorCount
public DefaultMessageChannelMetrics()
public DefaultMessageChannelMetrics(String name)
window=10, period=1 second,
lapsePeriod=1 minute.name - the name.public DefaultMessageChannelMetrics(String name, ExponentialMovingAverage sendDuration, ExponentialMovingAverageRate sendErrorRate, ExponentialMovingAverageRatio sendSuccessRatio, ExponentialMovingAverageRate sendRate)
factor=1000000. and the the other arguments
must be created with the millis constructor argument set to true.name - the name.sendDuration - an ExponentialMovingAverage for calculating the send duration.sendErrorRate - an ExponentialMovingAverageRate for calculating the send error rate.sendSuccessRatio - an ExponentialMovingAverageRatio for calculating the success ratio.sendRate - an ExponentialMovingAverageRate for calculating the send rate.public void destroy()
public MetricsContext beforeSend()
AbstractMessageChannelMetricsbeforeSend in class AbstractMessageChannelMetricsAbstractMessageChannelMetrics.afterSend(MetricsContext, boolean)
call.public void afterSend(MetricsContext context, boolean result)
AbstractMessageChannelMetricsAbstractMessageChannelMetrics.beforeSend() call.afterSend in class AbstractMessageChannelMetricscontext - the context.result - true for success, false otherwise.public void reset()
AbstractMessageChannelMetricsreset in class AbstractMessageChannelMetricspublic int getSendCount()
getSendCount in class AbstractMessageChannelMetricspublic long getSendCountLong()
getSendCountLong in class AbstractMessageChannelMetricspublic int getSendErrorCount()
getSendErrorCount in class AbstractMessageChannelMetricspublic long getSendErrorCountLong()
getSendErrorCountLong in class AbstractMessageChannelMetricspublic double getTimeSinceLastSend()
getTimeSinceLastSend in class AbstractMessageChannelMetricspublic double getMeanSendRate()
getMeanSendRate in class AbstractMessageChannelMetricspublic double getMeanErrorRate()
getMeanErrorRate in class AbstractMessageChannelMetricspublic double getMeanErrorRatio()
getMeanErrorRatio in class AbstractMessageChannelMetricspublic double getMeanSendDuration()
getMeanSendDuration in class AbstractMessageChannelMetricspublic double getMinSendDuration()
getMinSendDuration in class AbstractMessageChannelMetricspublic double getMaxSendDuration()
getMaxSendDuration in class AbstractMessageChannelMetricspublic double getStandardDeviationSendDuration()
getStandardDeviationSendDuration in class AbstractMessageChannelMetricspublic Statistics getSendDuration()
getSendDuration in class AbstractMessageChannelMetricspublic Statistics getSendRate()
getSendRate in class AbstractMessageChannelMetricspublic Statistics getErrorRate()
getErrorRate in class AbstractMessageChannelMetricspublic void afterReceive()
afterReceive in class AbstractMessageChannelMetricspublic void afterError()
afterError in class AbstractMessageChannelMetricspublic int getReceiveCount()
getReceiveCount in class AbstractMessageChannelMetricspublic long getReceiveCountLong()
getReceiveCountLong in class AbstractMessageChannelMetricspublic int getReceiveErrorCount()
getReceiveErrorCount in class AbstractMessageChannelMetricspublic long getReceiveErrorCountLong()
getReceiveErrorCountLong in class AbstractMessageChannelMetrics