Modifier and Type | Class and Description |
---|---|
static class |
ThresholdMeter.ThresholdExceedException
Exception thrown when a threshold exceeds.
|
Constructor and Description |
---|
ThresholdMeter(double maxEventsPerInterval,
Duration interval) |
ThresholdMeter(double maxEventsPerInterval,
Duration interval,
Clock clock) |
Modifier and Type | Method and Description |
---|---|
void |
checkAgainstThreshold() |
long |
getCount()
Get number of events marked on the meter.
|
double |
getRate()
Returns the current rate of events per second.
|
void |
markEvent()
Mark occurrence of an event.
|
void |
markEvent(long n)
Mark occurrence of multiple events.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getMetricType
public ThresholdMeter(double maxEventsPerInterval, Duration interval)
@VisibleForTesting public ThresholdMeter(double maxEventsPerInterval, Duration interval, Clock clock)
public void markEvent()
Meter
public void markEvent(long n)
Meter
public double getRate()
Meter
public long getCount()
Meter
public void checkAgainstThreshold() throws ThresholdMeter.ThresholdExceedException
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.