Search in sources :

Example 11 with DistributionSummary

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());
}
Also used : DistributionSummary(io.micrometer.core.instrument.DistributionSummary) SimpleMeterRegistry(io.micrometer.core.instrument.simple.SimpleMeterRegistry) Test(org.junit.Test)

Aggregations

DistributionSummary (io.micrometer.core.instrument.DistributionSummary)11 Test (org.junit.jupiter.api.Test)5 SimpleMeterRegistry (io.micrometer.core.instrument.simple.SimpleMeterRegistry)4 Test (org.junit.Test)4 DisplayName (org.junit.jupiter.api.DisplayName)4 MeterRegistry (io.micrometer.core.instrument.MeterRegistry)2 Timer (io.micrometer.core.instrument.Timer)2 Match (io.vertx.micrometer.Match)2 JsonProcessingException (com.fasterxml.jackson.core.JsonProcessingException)1 Issue (io.micrometer.core.Issue)1 FunctionTimer (io.micrometer.core.instrument.FunctionTimer)1 Gauge (io.micrometer.core.instrument.Gauge)1 LongTaskTimer (io.micrometer.core.instrument.LongTaskTimer)1 Meter (io.micrometer.core.instrument.Meter)1 CumulativeDistributionSummary (io.micrometer.core.instrument.cumulative.CumulativeDistributionSummary)1 CumulativeFunctionTimer (io.micrometer.core.instrument.cumulative.CumulativeFunctionTimer)1 CumulativeTimer (io.micrometer.core.instrument.cumulative.CumulativeTimer)1 DefaultLongTaskTimer (io.micrometer.core.instrument.internal.DefaultLongTaskTimer)1 DefaultMeter (io.micrometer.core.instrument.internal.DefaultMeter)1 ArrayList (java.util.ArrayList)1