use of io.micrometer.core.instrument.simple.SimpleConfig in project micrometer by micrometer-metrics.
the class DistributionSummaryTest method histogramsInStepMode.
@Test
void histogramsInStepMode() {
MockClock clock = new MockClock();
MeterRegistry registry = new SimpleMeterRegistry(new SimpleConfig() {
@Override
public String get(String key) {
return null;
}
@Override
public CountingMode mode() {
return CountingMode.STEP;
}
}, clock);
DistributionSummary summary = DistributionSummary.builder("my.summary").sla(1).register(registry);
summary.record(1);
assertThat(summary.takeSnapshot().histogramCounts()).containsExactly(new CountAtBucket(1, 1));
clock.add(SimpleConfig.DEFAULT.step());
assertThat(summary.takeSnapshot().histogramCounts()).containsExactly(new CountAtBucket(1, 0));
}
use of io.micrometer.core.instrument.simple.SimpleConfig in project spring-boot by spring-projects.
the class SimplePropertiesTests method defaultValuesAreConsistent.
@Test
void defaultValuesAreConsistent() {
SimpleProperties properties = new SimpleProperties();
SimpleConfig config = SimpleConfig.DEFAULT;
assertThat(properties.getStep()).isEqualTo(config.step());
assertThat(properties.getMode()).isEqualTo(config.mode());
}
Aggregations