use of io.micrometer.core.instrument.step.StepTimer in project micrometer by micrometer-metrics.
the class SimpleMeterRegistry method newTimer.
@Override
protected Timer newTimer(Meter.Id id, DistributionStatisticConfig distributionStatisticConfig, PauseDetector pauseDetector) {
DistributionStatisticConfig merged = distributionStatisticConfig.merge(DistributionStatisticConfig.builder().expiry(config.step()).build());
Timer timer;
switch(config.mode()) {
case CUMULATIVE:
timer = new CumulativeTimer(id, clock, merged, pauseDetector, getBaseTimeUnit(), false);
break;
case STEP:
default:
timer = new StepTimer(id, clock, merged, pauseDetector, getBaseTimeUnit(), false);
break;
}
HistogramGauges.registerWithCommonFormat(timer, this);
return timer;
}
Aggregations