Class AveragingMetricProvider

    • Constructor Detail

      • AveragingMetricProvider

        public AveragingMetricProvider​(AveragingMetricProvider.MetricProvider metricProvider,
                                       int numSamples,
                                       long sampleInterval)
        Creates an instance with an executor that runs every sampleInterval seconds and averages over numSamples samples.
        metricProvider - metric provider that will provide a value
        numSamples - number of samples to calculate average for
        sampleInterval - interval between each sample
    • Method Detail

      • getMetricValue

        public double getMetricValue()
        Return current average. This is a cached value, so calling this method will not incur any calculations