public class SimpleMeterRegistry extends AbstractMeterRegistry
clock
Constructor and Description |
---|
SimpleMeterRegistry() |
SimpleMeterRegistry(Clock clock) |
Modifier and Type | Method and Description |
---|---|
void |
clear()
Clear the registry of all monitored meters and their values.
|
Counter |
counter(java.lang.String name,
java.lang.Iterable<Tag> tags)
Measures the rate of some activity.
|
DistributionSummary |
distributionSummary(java.lang.String name,
java.lang.Iterable<Tag> tags,
Quantiles quantiles,
Histogram<?> histogram) |
<M extends Meter> |
findMeter(java.lang.Class<M> mClass,
java.lang.String name,
java.lang.Iterable<Tag> tags) |
java.util.Optional<Meter> |
findMeter(Meter.Type type,
java.lang.String name,
java.lang.Iterable<Tag> tags) |
<T> T |
gauge(java.lang.String name,
java.lang.Iterable<Tag> tags,
T obj,
java.util.function.ToDoubleFunction<T> f)
Register a gauge that reports the value of the object after the function
f is applied. |
java.util.Collection<Meter> |
getMeters() |
LongTaskTimer |
longTaskTimer(java.lang.String name,
java.lang.Iterable<Tag> tags)
Measures the time taken for short tasks.
|
MeterRegistry |
register(Meter meter) |
protected Timer |
timer(java.lang.String name,
java.lang.Iterable<Tag> tags,
Quantiles quantiles,
Histogram<?> histogram) |
getClock, summaryBuilder, timerBuilder
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
collectionSize, collectionSize, counter, findMeter, findMeter, gauge, gauge, gauge, longTaskTimer, mapSize, mapSize, summary, summary, timer, timer
public SimpleMeterRegistry()
public SimpleMeterRegistry(Clock clock)
public Counter counter(java.lang.String name, java.lang.Iterable<Tag> tags)
MeterRegistry
public DistributionSummary distributionSummary(java.lang.String name, java.lang.Iterable<Tag> tags, Quantiles quantiles, Histogram<?> histogram)
distributionSummary
in class AbstractMeterRegistry
protected Timer timer(java.lang.String name, java.lang.Iterable<Tag> tags, Quantiles quantiles, Histogram<?> histogram)
timer
in class AbstractMeterRegistry
public LongTaskTimer longTaskTimer(java.lang.String name, java.lang.Iterable<Tag> tags)
MeterRegistry
public MeterRegistry register(Meter meter)
public <T> T gauge(java.lang.String name, java.lang.Iterable<Tag> tags, T obj, java.util.function.ToDoubleFunction<T> f)
MeterRegistry
f
is applied. The registration will keep a weak reference to the object so it will
not prevent garbage collection. Applying f
on the object should be thread safe.
If multiple gauges are registered with the same id, then the values will be aggregated and the sum will be reported. For example, registering multiple gauges for active threads in a thread pool with the same id would produce a value that is the overall number of active threads. For other behaviors, manage it on the user side and avoid multiple registrations.
name
- Name of the gauge being registered.tags
- Sequence of dimensions for breaking down the getName.obj
- Object used to compute a value.f
- Function that is applied on the value for the number.public java.util.Collection<Meter> getMeters()
public <M extends Meter> java.util.Optional<M> findMeter(java.lang.Class<M> mClass, java.lang.String name, java.lang.Iterable<Tag> tags)
public java.util.Optional<Meter> findMeter(Meter.Type type, java.lang.String name, java.lang.Iterable<Tag> tags)
public void clear()