@Test @SuppressWarnings("unchecked") public void gaugePublicationDecisions() { AtomicLong valueOne = new AtomicLong(1L); AtomicLong valueTwo = new AtomicLong(100L); AtomicLong valueThree = new AtomicLong(100L); Gauge<Long> gaugeOne = valueOne::get; Gauge<Long> gaugeTwo = valueTwo::get; Gauge<Long> gaugeThree = valueThree::get; Map<Gauge<Long>, MetricPublicationFilter> filters = registerAndCreatePublicationFilters( Stream.of(gaugeOne, gaugeTwo, gaugeThree)); assertThat(defaultController.getMeanGauge().getValue()).isEqualTo(67.0); assertThat(filters.get(gaugeOne).shouldPublish()).isTrue(); assertThat(filters.get(gaugeTwo).shouldPublish()).isFalse(); assertThat(filters.get(gaugeThree).shouldPublish()).isFalse(); valueOne.set(100L); valueThree.set(1L); tick.addAndGet(DistributionOutlierController.REFRESH_INTERVAL.toNanos() + 1); assertThat(defaultController.getMeanGauge().getValue()).isEqualTo(67.0); assertThat(filters.get(gaugeOne).shouldPublish()).isFalse(); assertThat(filters.get(gaugeTwo).shouldPublish()).isFalse(); assertThat(filters.get(gaugeThree).shouldPublish()).isTrue(); valueThree.set(100L); tick.addAndGet(DistributionOutlierController.REFRESH_INTERVAL.toNanos() + 1); assertThat(defaultController.getMeanGauge().getValue()).isEqualTo(100.0); assertThat(filters.get(gaugeOne).shouldPublish()).isFalse(); assertThat(filters.get(gaugeTwo).shouldPublish()).isFalse(); assertThat(filters.get(gaugeThree).shouldPublish()).isFalse(); }
Gauge<Double> getMeanGauge() { return meanGauge; }
DistributionOutlierController { Gauge<Double> getMeanGauge() { return meanGauge; } }
DistributionOutlierController { Gauge<Double> getMeanGauge() { return meanGauge; } @VisibleForTesting  DistributionOutlierController(
            Clock clock,
            double minimumMeanMultiple,
            double maximumMeanMultiple); }
DistributionOutlierController { Gauge<Double> getMeanGauge() { return meanGauge; } @VisibleForTesting  DistributionOutlierController(
            Clock clock,
            double minimumMeanMultiple,
            double maximumMeanMultiple);  }
DistributionOutlierController { Gauge<Double> getMeanGauge() { return meanGauge; } @VisibleForTesting  DistributionOutlierController(
            Clock clock,
            double minimumMeanMultiple,
            double maximumMeanMultiple);   }