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,
Duration interval) |
ThresholdMeter(double maxEventsPerInterval,
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,
Duration interval)
@VisibleForTesting
public ThresholdMeter(double maxEventsPerInterval,
Duration interval,
org.apache.flink.util.clock.Clock clock)
public void markEvent()
markEvent in interface org.apache.flink.metrics.Meterpublic void markEvent(long n)
markEvent in interface org.apache.flink.metrics.Meterpublic double getRate()
getRate in interface org.apache.flink.metrics.Meterpublic long getCount()
getCount in interface org.apache.flink.metrics.Meterpublic void checkAgainstThreshold()
throws ThresholdMeter.ThresholdExceedException
Copyright © 2014–2025 The Apache Software Foundation. All rights reserved.