Search in sources :

Example 1 with StepDistributionSummary

use of io.micrometer.core.instrument.step.StepDistributionSummary in project micrometer by micrometer-metrics.

the class SimpleMeterRegistry method newDistributionSummary.

@Override
protected DistributionSummary newDistributionSummary(Meter.Id id, DistributionStatisticConfig distributionStatisticConfig, double scale) {
    DistributionStatisticConfig merged = distributionStatisticConfig.merge(DistributionStatisticConfig.builder().expiry(config.step()).build());
    DistributionSummary summary;
    switch(config.mode()) {
        case CUMULATIVE:
            summary = new CumulativeDistributionSummary(id, clock, merged, scale, false);
            break;
        case STEP:
        default:
            summary = new StepDistributionSummary(id, clock, merged, scale, false);
            break;
    }
    HistogramGauges.registerWithCommonFormat(summary, this);
    return summary;
}
Also used : StepDistributionSummary(io.micrometer.core.instrument.step.StepDistributionSummary) StepDistributionSummary(io.micrometer.core.instrument.step.StepDistributionSummary) DistributionStatisticConfig(io.micrometer.core.instrument.distribution.DistributionStatisticConfig)

Aggregations

DistributionStatisticConfig (io.micrometer.core.instrument.distribution.DistributionStatisticConfig)1 StepDistributionSummary (io.micrometer.core.instrument.step.StepDistributionSummary)1