io.micrometer.core.instrument.noop.NoopTimer Java Examples

The following examples show how to use io.micrometer.core.instrument.noop.NoopTimer. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: MeterRegistryTest.java    From micrometer with Apache License 2.0 5 votes vote down vote up
@Test
void noopMetersAfterRegistryClosed() {
    assertThat(registry.timer("my.timer.before")).isNotInstanceOf(NoopTimer.class);
    registry.close();

    assertThat(registry.isClosed()).isTrue();

    assertThat(registry.timer("my.timer.before")).isNotInstanceOf(NoopTimer.class);
    assertThat(registry.timer("my.timer.after")).isInstanceOf(NoopTimer.class);
}
 
Example #2
Source File: CompositeTimer.java    From micrometer with Apache License 2.0 4 votes vote down vote up
@Override
Timer newNoopMeter() {
    return new NoopTimer(getId());
}
 
Example #3
Source File: TimerMetricsConverterTest.java    From cf-java-logging-support with Apache License 2.0 4 votes vote down vote up
public TimerMetricsConverterTest() {
    super(new NoopTimer(ID), new TimerMetricsConverter());
}
 
Example #4
Source File: NoopMeterRegistry.java    From dolphin-platform with Apache License 2.0 4 votes vote down vote up
@Override
protected Timer newTimer(final Meter.Id id, final DistributionStatisticConfig distributionStatisticConfig, final PauseDetector pauseDetector) {
    return new NoopTimer(id);
}
 
Example #5
Source File: NoopMeterRegistry.java    From armeria with Apache License 2.0 4 votes vote down vote up
@Override
protected Timer newTimer(Id id, DistributionStatisticConfig histogramConfig, PauseDetector pauseDetector) {
    return new NoopTimer(id);
}
 
Example #6
Source File: MeterRegistry.java    From micrometer with Apache License 2.0 3 votes vote down vote up
/**
 * Only used by {@link Timer#builder(String)}.
 *
 * @param id                          The identifier for this timer.
 * @param distributionStatisticConfig Configuration that governs how distribution statistics are computed.
 * @return A new or existing timer.
 */
Timer timer(Meter.Id id, DistributionStatisticConfig distributionStatisticConfig, PauseDetector pauseDetectorOverride) {
    return registerMeterIfNecessary(Timer.class, id, distributionStatisticConfig, (id2, filteredConfig) -> {
        Meter.Id withUnit = id2.withBaseUnit(getBaseTimeUnitStr());
        return newTimer(withUnit, filteredConfig.merge(defaultHistogramConfig()), pauseDetectorOverride);
    }, NoopTimer::new);
}