Class 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.

    • Constructor Detail

      • ThresholdMeter

        public ThresholdMeter​(double maxEventsPerInterval,
                              Duration interval)
      • ThresholdMeter

        @VisibleForTesting
        public ThresholdMeter​(double maxEventsPerInterval,
                              Duration interval,
                              org.apache.flink.util.clock.Clock clock)
    • Method Detail

      • markEvent

        public void markEvent()
        Specified by:
        markEvent in interface org.apache.flink.metrics.Meter
      • markEvent

        public void markEvent​(long n)
        Specified by:
        markEvent in interface org.apache.flink.metrics.Meter
      • getRate

        public double getRate()
        Specified by:
        getRate in interface org.apache.flink.metrics.Meter
      • getCount

        public long getCount()
        Specified by:
        getCount in interface org.apache.flink.metrics.Meter