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

The following examples show how to use io.micrometer.core.instrument.noop.NoopFunctionTimer. 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: CompositeFunctionTimer.java    From micrometer with Apache License 2.0 4 votes vote down vote up
@Override
FunctionTimer newNoopMeter() {
    return new NoopFunctionTimer(getId());
}
 
Example #2
Source File: FunctionTimerMetricsConverterTest.java    From cf-java-logging-support with Apache License 2.0 4 votes vote down vote up
public FunctionTimerMetricsConverterTest() {
    super(new NoopFunctionTimer(ID), new FunctionTimerMetricsConverter());
}
 
Example #3
Source File: NoopMeterRegistry.java    From dolphin-platform with Apache License 2.0 4 votes vote down vote up
@Override
protected <T> FunctionTimer newFunctionTimer(final Meter.Id id, final T obj, final ToLongFunction<T> countFunction, final ToDoubleFunction<T> totalTimeFunction, final TimeUnit totalTimeFunctionUnits) {
    return new NoopFunctionTimer(id);
}
 
Example #4
Source File: NoopMeterRegistry.java    From armeria with Apache License 2.0 4 votes vote down vote up
@Override
protected <T> FunctionTimer newFunctionTimer(Id id, T obj, ToLongFunction<T> countFunction,
                                             ToDoubleFunction<T> totalTimeFunction,
                                             TimeUnit totalTimeFunctionUnits) {
    return new NoopFunctionTimer(id);
}
 
Example #5
Source File: MeterRegistry.java    From micrometer with Apache License 2.0 3 votes vote down vote up
/**
 * A timer that tracks monotonically increasing functions for count and totalTime.
 *
 * @param id                    The identifier for this function timer.
 * @param obj                   State object used to compute a value.
 * @param countFunction         Function that produces a monotonically increasing counter value from the state object.
 * @param totalTimeFunction     Function that produces a monotonically increasing total time value from the state object.
 * @param totalTimeFunctionUnit The base unit of time produced by the total time function.
 * @param <T>                   The type of the state object from which the function values are extracted.F
 * @return A new or existing function timer.
 */
<T> FunctionTimer timer(Meter.Id id, T obj,
                        ToLongFunction<T> countFunction,
                        ToDoubleFunction<T> totalTimeFunction,
                        TimeUnit totalTimeFunctionUnit) {
    return registerMeterIfNecessary(FunctionTimer.class, id, id2 -> {
        Meter.Id withUnit = id2.withBaseUnit(getBaseTimeUnitStr());
        return newFunctionTimer(withUnit, obj, countFunction, totalTimeFunction, totalTimeFunctionUnit);
    }, NoopFunctionTimer::new);
}