public class ThresholdMeter extends Object implements org.apache.flink.metrics.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.
Modifier and Type | Class and Description |
---|---|
static class |
ThresholdMeter.ThresholdExceedException
Exception thrown when a threshold exceeds.
|
Constructor and Description |
---|
ThresholdMeter(double maxEventsPerInterval,
java.time.Duration interval) |
ThresholdMeter(double maxEventsPerInterval,
java.time.Duration interval,
org.apache.flink.util.clock.Clock clock) |
Modifier and Type | Method and Description |
---|---|
void |
checkAgainstThreshold() |
long |
getCount() |
double |
getRate() |
void |
markEvent() |
void |
markEvent(long n) |
public ThresholdMeter(double maxEventsPerInterval, java.time.Duration interval)
@VisibleForTesting public ThresholdMeter(double maxEventsPerInterval, java.time.Duration interval, org.apache.flink.util.clock.Clock clock)
public void markEvent()
markEvent
in interface org.apache.flink.metrics.Meter
public void markEvent(long n)
markEvent
in interface org.apache.flink.metrics.Meter
public double getRate()
getRate
in interface org.apache.flink.metrics.Meter
public long getCount()
getCount
in interface org.apache.flink.metrics.Meter
public void checkAgainstThreshold() throws ThresholdMeter.ThresholdExceedException
Copyright © 2014–2021 The Apache Software Foundation. All rights reserved.