-
-
Method Summary
| Modifier and Type |
Method |
Description |
static CallMeter.Builder |
builder() |
|
static <T> java.util.concurrent.Callable<T> |
decorateCallable(CallMeterBase meter,
java.util.concurrent.Callable<T> callable) |
Creates a timed Callable.
|
static <T,
R> io.vavr.CheckedFunction1<T,R> |
decorateCheckedFunction(CallMeterBase meter,
io.vavr.CheckedFunction1<T,R> function) |
Creates a timed function.
|
static io.vavr.CheckedRunnable |
decorateCheckedRunnable(CallMeterBase meter,
io.vavr.CheckedRunnable runnable) |
Creates a timed runnable.
|
static <T> io.vavr.CheckedFunction0<T> |
decorateCheckedSupplier(CallMeterBase meter,
io.vavr.CheckedFunction0<T> supplier) |
Creates a timed checked supplier.
|
static <T> java.util.function.Supplier<java.util.concurrent.CompletionStage<T>> |
decorateCompletionStageSupplier(CallMeterBase meter,
java.util.function.Supplier<java.util.concurrent.CompletionStage<T>> stageSupplier) |
Decorates completion stage supplier with call meter
|
static <T,
R> java.util.function.Function<T,R> |
decorateFunction(CallMeterBase meter,
java.util.function.Function<T,R> function) |
Creates a timed function.
|
static java.lang.Runnable |
decorateRunnable(CallMeterBase meter,
java.lang.Runnable runnable) |
Creates a timed runnable.
|
static <T> java.util.function.Supplier<T> |
decorateSupplier(CallMeterBase meter,
java.util.function.Supplier<T> supplier) |
Creates a timed checked supplier.
|
CallMeter.Child |
labels(java.lang.String... labels) |
Creates a child call meter with the given labels
|
static CallMeter |
of(java.lang.String name,
java.lang.String help) |
Creates call meter with the given name and help message
|
static CallMeter |
ofCollectorRegistry(java.lang.String name,
java.lang.String help,
io.prometheus.client.CollectorRegistry registry) |
Creates call meter with the given name and registers it in the specified collector registry
|
default CallMeter |
register() |
Register this call meter with the default registry.
|
CallMeter |
register(io.prometheus.client.CollectorRegistry registry) |
Registers this call meter with the given registry.
|
-
Method Details
-
static CallMeter of(
java.lang.String name,
java.lang.String help)
Creates call meter with the given name and help message
- Parameters:
name - - metric name
help - - metric help
- Returns:
- the call meter
-
static CallMeter ofCollectorRegistry(
java.lang.String name,
java.lang.String help,
io.prometheus.client.CollectorRegistry registry)
Creates call meter with the given name and registers it in the specified collector registry
- Parameters:
name - - metric name
help - - metric help
registry - - collector registry
- Returns:
- the call meter
-
-
static <T> io.vavr.CheckedFunction0<T> decorateCheckedSupplier(
CallMeterBase meter,
io.vavr.CheckedFunction0<T> supplier)
Creates a timed checked supplier.
- Parameters:
meter - the call meter to use
supplier - the original supplier
- Returns:
- a timed supplier
-
static io.vavr.CheckedRunnable decorateCheckedRunnable(
CallMeterBase meter,
io.vavr.CheckedRunnable runnable)
Creates a timed runnable.
- Parameters:
meter - the call meter to use
runnable - the original runnable
- Returns:
- a timed runnable
-
static <T> java.util.function.Supplier<T> decorateSupplier(
CallMeterBase meter,
java.util.function.Supplier<T> supplier)
Creates a timed checked supplier.
- Parameters:
meter - the call meter to use
supplier - the original supplier
- Returns:
- a timed supplier
-
static <T> java.util.concurrent.Callable<T> decorateCallable(
CallMeterBase meter,
java.util.concurrent.Callable<T> callable)
Creates a timed Callable.
- Parameters:
meter - the call meter to use
callable - the original Callable
- Returns:
- a timed Callable
-
static java.lang.Runnable decorateRunnable(
CallMeterBase meter,
java.lang.Runnable runnable)
Creates a timed runnable.
- Parameters:
meter - the call meter to use
runnable - the original runnable
- Returns:
- a timed runnable
-
static <T,
R> java.util.function.Function<T,R> decorateFunction(
CallMeterBase meter,
java.util.function.Function<T,R> function)
Creates a timed function.
- Parameters:
meter - the call meter to use
function - the original function
- Returns:
- a timed function
-
static <T,
R> io.vavr.CheckedFunction1<T,R> decorateCheckedFunction(
CallMeterBase meter,
io.vavr.CheckedFunction1<T,R> function)
Creates a timed function.
- Parameters:
meter - the call meter to use
function - the original function
- Returns:
- a timed function
-
static <T>
java.util.function.Supplier<java.util.concurrent.CompletionStage<T>> decorateCompletionStageSupplier(
CallMeterBase meter,
java.util.function.Supplier<java.util.concurrent.CompletionStage<T>> stageSupplier)
Decorates completion stage supplier with call meter
- Parameters:
meter - the call meter to use
stageSupplier - the CompletionStage Supplier
- Returns:
- a decorated completion stage
-
Creates a child call meter with the given labels
- Parameters:
labels -
- Returns:
- child collector
-
Register this call meter with the default registry.
-
CallMeter register(
io.prometheus.client.CollectorRegistry registry)
Registers this call meter with the given registry.