public static class Meters.Builder
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
Meter |
create(java.util.function.Function<java.lang.String,java.lang.Iterable<Measurement>> measure) |
<T> Meter |
create(T obj,
java.util.function.BiFunction<java.lang.String,T,java.lang.Iterable<Measurement>> measure) |
Meters.Builder |
tags(java.lang.Iterable<Tag> tags) |
Meters.Builder |
tags(java.lang.String... tags) |
Meters.Builder |
type(Meter.Type type) |
public Meters.Builder tags(java.lang.Iterable<Tag> tags)
public Meters.Builder tags(java.lang.String... tags)
public Meters.Builder type(Meter.Type type)
public Meter create(java.util.function.Function<java.lang.String,java.lang.Iterable<Measurement>> measure)
measure
- A function of meter name to a set of measurements. The generated measurements
will be enriched with the containing meter's tags automatically.public <T> Meter create(T obj, java.util.function.BiFunction<java.lang.String,T,java.lang.Iterable<Measurement>> measure)
obj
- The monitored object. Access to this object's state from the meter must be thread safe. For
example, if the monitored object is a collection type, ensure it is from the java.util.concurrent
package.measure
- A function of a meter name and a monitored object to a set of measurements. The generated measurements
will be enriched with the containing meter's tags automatically. The monitored object is held with
a weak reference, so as not to prevent garbage collection of the underlying object.