Package io.quarkus.runtime.metrics
Interface MetricsFactory.MetricBuilder
- Enclosing interface:
- MetricsFactory
public static interface MetricsFactory.MetricBuilder
-
Method Summary
Modifier and TypeMethodDescriptionvoidbuildCounter(Supplier<Number> countFunction) Register a counter that retrieves its value from a supplier function<T,R extends Number>
voidbuildCounter(T obj, Function<T, R> countFunction) Register a counter that retrieves its value by the applying a function to an objectvoidbuildGauge(Supplier<Number> gaugeFunction) Register a gauge that retrieves its value from a supplier function<T,R extends Number>
voidbuildGauge(T obj, Function<T, R> gaugeFunction) Register a gauge that retrieves its value by applying a function to an objectWrap aRunnableso that it is timed when invoked.<T> Callable<T>buildTimer(Callable<T> f) Wrap aCallableso that it is timed when invoked.<T> Supplier<T>buildTimer(Supplier<T> f) Wrap aSupplierso that it is timed when invoked.description(String description) Specify the metric unit (optional)
-
Method Details
-
description
- Parameters:
description- Description text of the eventual metric (optional).- Returns:
- The builder with added description.
-
tag
- Parameters:
key- The tag key.value- The tag value.- Returns:
- The builder with added tag.
-
unit
Specify the metric unit (optional)- Parameters:
unit- Base unit of the eventual metric- Returns:
- The builder with added base unit.
-
buildCounter
Register a counter that retrieves its value from a supplier function- Parameters:
countFunction- Function supplying a monotonically increasing number value
-
buildCounter
Register a counter that retrieves its value by the applying a function to an object- Parameters:
obj- Object instance to observecountFunction- Function returning a monotonically increasing value
-
buildGauge
Register a gauge that retrieves its value from a supplier function- Parameters:
gaugeFunction- Function supplying number value
-
buildGauge
Register a gauge that retrieves its value by applying a function to an object- Parameters:
obj- Object instance to observegaugeFunction- Function returning a number value
-
buildTimer
MetricsFactory.TimeRecorder buildTimer()- Returns:
- TimeRecorder to measure passage of time using incremental updates.
-
buildTimer
Wrap aRunnableso that it is timed when invoked.- Parameters:
f- The Runnable to time when it is invoked.- Returns:
- The wrapped Runnable.
-
buildTimer
Wrap aCallableso that it is timed when invoked.- Type Parameters:
T- The return type of the callable.- Parameters:
f- The Callable to time when it is invoked.- Returns:
- The wrapped callable.
-
buildTimer
Wrap aSupplierso that it is timed when invoked.- Type Parameters:
T- The return type of theSupplierresult.- Parameters:
f- TheSupplierto time when it is invoked.- Returns:
- The wrapped supplier.
-