Package io.quarkus.runtime.metrics
Interface MetricsFactory.MetricBuilder
-
- Enclosing interface:
- MetricsFactory
public static interface MetricsFactory.MetricBuilder
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidbuildCounter(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 objectMetricsFactory.TimeRecorderbuildTimer()RunnablebuildTimer(Runnable f)Wrap 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.MetricsFactory.MetricBuilderdescription(String description)MetricsFactory.MetricBuildertag(String key, String value)MetricsFactory.MetricBuilderunit(String unit)Specify the metric unit (optional)
-
-
-
Method Detail
-
description
MetricsFactory.MetricBuilder description(String description)
- Parameters:
description- Description text of the eventual metric (optional).- Returns:
- The builder with added description.
-
tag
MetricsFactory.MetricBuilder tag(String key, String value)
- Parameters:
key- The tag key.value- The tag value.- Returns:
- The builder with added tag.
-
unit
MetricsFactory.MetricBuilder unit(String unit)
Specify the metric unit (optional)- Parameters:
unit- Base unit of the eventual metric- Returns:
- The builder with added base unit.
-
buildCounter
void buildCounter(Supplier<Number> countFunction)
Register a counter that retrieves its value from a supplier function- Parameters:
countFunction- Function supplying a monotonically increasing number value
-
buildCounter
<T,R extends Number> void buildCounter(T obj, Function<T,R> countFunction)
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
void buildGauge(Supplier<Number> gaugeFunction)
Register a gauge that retrieves its value from a supplier function- Parameters:
gaugeFunction- Function supplying number value
-
buildGauge
<T,R extends Number> void buildGauge(T obj, Function<T,R> gaugeFunction)
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
Runnable buildTimer(Runnable f)
Wrap aRunnableso that it is timed when invoked.- Parameters:
f- The Runnable to time when it is invoked.- Returns:
- The wrapped Runnable.
-
buildTimer
<T> Callable<T> buildTimer(Callable<T> f)
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.
-
-