@Test public void shouldUpdateMeanMetric() { double newMean = INITIAL_MEAN + 5; when(snapshot.getMean()).thenReturn(newMean); adapter.updateMonitorables(); assertThat(extractMonitorables(adapter).get(MEAN).get(), Matchers.<Object>is(newMean)); }
@Override public void updateMonitorables() { Snapshot snapshot = samplingMetric.getSnapshot(); mean.set(snapshot.getMean()); median.set(snapshot.getMedian()); max.set(snapshot.getMax()); min.set(snapshot.getMin()); stddev.set(snapshot.getStdDev()); seventyFifthPercentile.set(snapshot.get75thPercentile()); ninetyFifthPercentile.set(snapshot.get95thPercentile()); ninetyEighthPercentile.set(snapshot.get98thPercentile()); ninetyNinthPercentile.set(snapshot.get99thPercentile()); threeNinesPercentile.set(snapshot.get999thPercentile()); }
SamplingAdapter implements MetricAdapter { @Override public void updateMonitorables() { Snapshot snapshot = samplingMetric.getSnapshot(); mean.set(snapshot.getMean()); median.set(snapshot.getMedian()); max.set(snapshot.getMax()); min.set(snapshot.getMin()); stddev.set(snapshot.getStdDev()); seventyFifthPercentile.set(snapshot.get75thPercentile()); ninetyFifthPercentile.set(snapshot.get95thPercentile()); ninetyEighthPercentile.set(snapshot.get98thPercentile()); ninetyNinthPercentile.set(snapshot.get99thPercentile()); threeNinesPercentile.set(snapshot.get999thPercentile()); } }
SamplingAdapter implements MetricAdapter { @Override public void updateMonitorables() { Snapshot snapshot = samplingMetric.getSnapshot(); mean.set(snapshot.getMean()); median.set(snapshot.getMedian()); max.set(snapshot.getMax()); min.set(snapshot.getMin()); stddev.set(snapshot.getStdDev()); seventyFifthPercentile.set(snapshot.get75thPercentile()); ninetyFifthPercentile.set(snapshot.get95thPercentile()); ninetyEighthPercentile.set(snapshot.get98thPercentile()); ninetyNinthPercentile.set(snapshot.get99thPercentile()); threeNinesPercentile.set(snapshot.get999thPercentile()); } SamplingAdapter(Sampling samplingMetric, String name, String description, Unit<?> unit);  SamplingAdapter(Sampling samplingMetric, String name, String description); }
SamplingAdapter implements MetricAdapter { @Override public void updateMonitorables() { Snapshot snapshot = samplingMetric.getSnapshot(); mean.set(snapshot.getMean()); median.set(snapshot.getMedian()); max.set(snapshot.getMax()); min.set(snapshot.getMin()); stddev.set(snapshot.getStdDev()); seventyFifthPercentile.set(snapshot.get75thPercentile()); ninetyFifthPercentile.set(snapshot.get95thPercentile()); ninetyEighthPercentile.set(snapshot.get98thPercentile()); ninetyNinthPercentile.set(snapshot.get99thPercentile()); threeNinesPercentile.set(snapshot.get999thPercentile()); } SamplingAdapter(Sampling samplingMetric, String name, String description, Unit<?> unit);  SamplingAdapter(Sampling samplingMetric, String name, String description); @Override Set<Monitorable> getMonitorables(); @Override void updateMonitorables(); }
SamplingAdapter implements MetricAdapter { @Override public void updateMonitorables() { Snapshot snapshot = samplingMetric.getSnapshot(); mean.set(snapshot.getMean()); median.set(snapshot.getMedian()); max.set(snapshot.getMax()); min.set(snapshot.getMin()); stddev.set(snapshot.getStdDev()); seventyFifthPercentile.set(snapshot.get75thPercentile()); ninetyFifthPercentile.set(snapshot.get95thPercentile()); ninetyEighthPercentile.set(snapshot.get98thPercentile()); ninetyNinthPercentile.set(snapshot.get99thPercentile()); threeNinesPercentile.set(snapshot.get999thPercentile()); } SamplingAdapter(Sampling samplingMetric, String name, String description, Unit<?> unit);  SamplingAdapter(Sampling samplingMetric, String name, String description); @Override Set<Monitorable> getMonitorables(); @Override void updateMonitorables();  }