Package org.apache.flink.runtime.metrics
Class ThresholdMeter
- java.lang.Object
-
- org.apache.flink.runtime.metrics.ThresholdMeter
-
- All Implemented Interfaces:
org.apache.flink.metrics.Meter
,org.apache.flink.metrics.Metric
public class ThresholdMeter extends Object implements org.apache.flink.metrics.Meter
A timestamp queue based threshold meter.Note: This class is thread safe, at the price of synchronization overhead. Do not use this in performance sensitive scenarios, e.g., per-record updated metrics.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ThresholdMeter.ThresholdExceedException
Exception thrown when a threshold exceeds.
-
Constructor Summary
Constructors Constructor Description ThresholdMeter(double maxEventsPerInterval, Duration interval)
ThresholdMeter(double maxEventsPerInterval, Duration interval, org.apache.flink.util.clock.Clock clock)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
checkAgainstThreshold()
long
getCount()
double
getRate()
void
markEvent()
void
markEvent(long n)
-
-
-
Method Detail
-
markEvent
public void markEvent()
- Specified by:
markEvent
in interfaceorg.apache.flink.metrics.Meter
-
markEvent
public void markEvent(long n)
- Specified by:
markEvent
in interfaceorg.apache.flink.metrics.Meter
-
getRate
public double getRate()
- Specified by:
getRate
in interfaceorg.apache.flink.metrics.Meter
-
getCount
public long getCount()
- Specified by:
getCount
in interfaceorg.apache.flink.metrics.Meter
-
checkAgainstThreshold
public void checkAgainstThreshold() throws ThresholdMeter.ThresholdExceedException
-
-