public abstract class AbstractRegistry extends Object implements Registry
| Constructor and Description |
|---|
AbstractRegistry(Clock clock)
Create a new instance.
|
| Modifier and Type | Method and Description |
|---|---|
Clock |
clock()
The clock used by the registry for timing events.
|
Counter |
counter(Id id)
Measures the rate of some activity.
|
Id |
createId(String name)
Creates an identifier for a meter.
|
Id |
createId(String name,
Iterable<Tag> tags)
Creates an identifier for a meter.
|
DistributionSummary |
distributionSummary(Id id)
Measures the rate and variation in amount for some activity.
|
Meter |
get(Id id)
Returns the meter associated with a given id.
|
Iterator<Meter> |
iterator()
Iterator for traversing the set of meters in the registry.
|
protected abstract Counter |
newCounter(Id id)
Create a new counter instance for a given id.
|
protected abstract DistributionSummary |
newDistributionSummary(Id id)
Create a new distribution summary instance for a given id.
|
protected abstract Timer |
newTimer(Id id)
Create a new timer instance for a given id.
|
void |
register(Meter meter)
Add a custom meter to the registry.
|
Timer |
timer(Id id)
Measures the rate and time taken for short running tasks.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcollectionSize, collectionSize, counter, counter, counter, counter, counters, createDynamicId, createDynamicId, createId, createId, distributionSummaries, distributionSummary, distributionSummary, distributionSummary, distributionSummary, gauge, gauge, gauge, gauge, gauge, gauge, gauge, longTaskTimer, longTaskTimer, longTaskTimer, longTaskTimer, mapSize, mapSize, methodValue, methodValue, stream, timer, timer, timer, timer, timers, underlyingforEach, spliteratorpublic AbstractRegistry(Clock clock)
clock - Clock used for performing all timing measurements.protected abstract Counter newCounter(Id id)
id - Identifier used to lookup this meter in the registry.protected abstract DistributionSummary newDistributionSummary(Id id)
id - Identifier used to lookup this meter in the registry.protected abstract Timer newTimer(Id id)
id - Identifier used to lookup this meter in the registry.public final Clock clock()
Registrypublic final Id createId(String name)
Registrypublic final Id createId(String name, Iterable<Tag> tags)
Registrypublic void register(Meter meter)
Registrypublic final Counter counter(Id id)
Registrycounter in interface Registryid - Identifier created by a call to Registry.createId(java.lang.String)public final DistributionSummary distributionSummary(Id id)
RegistrydistributionSummary in interface Registryid - Identifier created by a call to Registry.createId(java.lang.String)public final Timer timer(Id id)
Registrytimer in interface Registryid - Identifier created by a call to Registry.createId(java.lang.String)public final Meter get(Id id)
Registry