use of io.micrometer.core.instrument.DistributionSummary in project tutorials by eugenp.
the class MicrometerAtlasTest method givenDistributionSummary_whenRecord_thenSummarized.
@Test
public void givenDistributionSummary_whenRecord_thenSummarized() {
SimpleMeterRegistry registry = new SimpleMeterRegistry();
DistributionSummary distributionSummary = DistributionSummary.builder("request.size").baseUnit("bytes").register(registry);
distributionSummary.record(3);
distributionSummary.record(4);
distributionSummary.record(5);
assertTrue(3 == distributionSummary.count());
assertTrue(12 == distributionSummary.totalAmount());
}
Aggregations