public abstract class SpectatorMeterRegistry extends AbstractMeterRegistry
| Modifier and Type | Field and Description |
|---|---|
protected java.util.Map<com.netflix.spectator.api.Meter,Meter> |
meterMap |
clock, commonTags| Constructor and Description |
|---|
SpectatorMeterRegistry(com.netflix.spectator.api.Registry registry,
Clock clock,
TagFormatter tagFormatter) |
| Modifier and Type | Method and Description |
|---|---|
Counter |
counter(java.lang.String name,
java.lang.Iterable<Tag> tags)
Tracks a monotonically increasing value.
|
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() |
com.netflix.spectator.api.Registry |
getSpectatorRegistry() |
LongTaskTimer |
longTaskTimer(java.lang.String name,
java.lang.Iterable<Tag> tags)
Measures the time taken for short tasks.
|
protected com.netflix.spectator.api.Counter |
newCounter(java.lang.String name,
java.lang.Iterable<Tag> tags)
If using a custom spectator Registry type that does not extend from AbstractRegistry, provide
a mechanism to create a new counter that doesn't register it with the registry.
|
MeterRegistry |
register(Meter meter) |
protected <T> T |
stepCounter(java.lang.String name,
java.lang.Iterable<Tag> tags,
T obj,
java.util.function.ToDoubleFunction<T> f,
long stepMillis)
Builds a step-interval based counter that is incremented on observation with the difference
between the current value of a monotonically increasing function
f and the last observation of f. |
protected Timer |
timer(java.lang.String name,
java.lang.Iterable<Tag> tags,
Quantiles quantiles,
Histogram<?> histogram) |
commonTags, getClock, summaryBuilder, timerBuilder, withCommonTagsclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcollectionSize, collectionSize, commonTags, counter, counter, counter, counter, counter, findMeter, findMeter, gauge, gauge, gauge, longTaskTimer, mapSize, mapSize, summary, summary, timer, timerprotected final java.util.Map<com.netflix.spectator.api.Meter,Meter> meterMap
public SpectatorMeterRegistry(com.netflix.spectator.api.Registry registry,
Clock clock,
TagFormatter tagFormatter)
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 Counter counter(java.lang.String name, java.lang.Iterable<Tag> tags)
MeterRegistryprotected com.netflix.spectator.api.Counter newCounter(java.lang.String name,
java.lang.Iterable<Tag> tags)
public DistributionSummary distributionSummary(java.lang.String name, java.lang.Iterable<Tag> tags, Quantiles quantiles, Histogram<?> histogram)
distributionSummary in class AbstractMeterRegistryprotected Timer timer(java.lang.String name, java.lang.Iterable<Tag> tags, Quantiles quantiles, Histogram<?> histogram)
timer in class AbstractMeterRegistrypublic LongTaskTimer longTaskTimer(java.lang.String name, java.lang.Iterable<Tag> tags)
MeterRegistrypublic 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)
MeterRegistryf 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 com.netflix.spectator.api.Registry getSpectatorRegistry()
Registry.protected <T> T stepCounter(java.lang.String name,
java.lang.Iterable<Tag> tags,
T obj,
java.util.function.ToDoubleFunction<T> f,
long stepMillis)
f and the last observation of f.