public class CapacityMonitor extends Object implements MessageMonitor<Message<?>>, com.codahale.metrics.MetricSet
MessageMonitor.MonitorCallback
Constructor and Description |
---|
CapacityMonitor()
Creates a capacity monitor with the default time window 10 minutes
|
CapacityMonitor(long window,
TimeUnit timeUnit)
Creates a capacity monitor with the default time window 10 minutes
|
CapacityMonitor(long window,
TimeUnit timeUnit,
com.codahale.metrics.Clock clock)
Creates a capacity monitor with the given time window.
|
Modifier and Type | Method and Description |
---|---|
Map<String,com.codahale.metrics.Metric> |
getMetrics() |
MessageMonitor.MonitorCallback |
onMessageIngested(Message<?> message)
Takes a message and returns a callback that should be used
to inform the message monitor about the result of processing the message
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
onMessagesIngested
public CapacityMonitor()
public CapacityMonitor(long window, TimeUnit timeUnit)
window
- The length of the window to measure the capacity overtimeUnit
- The time unit of the time windowpublic CapacityMonitor(long window, TimeUnit timeUnit, com.codahale.metrics.Clock clock)
window
- The length of the window to measure the capacity overtimeUnit
- The time unit of the time windowclock
- The clock used to measure the process time per messagepublic MessageMonitor.MonitorCallback onMessageIngested(Message<?> message)
MessageMonitor
onMessageIngested
in interface MessageMonitor<Message<?>>
message
- the message to monitorCopyright © 2010–2022. All rights reserved.