Adds a SentriesRegistryListener to a collection of listeners that will be notified on sentry creation.
Adds a SentriesRegistryListener to a collection of listeners that will be notified on sentry creation. Listeners will be notified in the order in which they are added.
N.B.: The listener will be notified of all existing sentries when it first registers.
the listener that will be notified
Remove all sentries from the registry.
Remove all sentries from the registry.
This is can be useful during tests where you want to be sure fresh new sentries are used for each test. The other approach is to call [#resetAllSentries].
Override to customize how com.yammer.metrics.core.MetricNames are created.
Override to customize how com.yammer.metrics.core.MetricNames are created.
the class which owns the sentry
the name of the sentry
the sentry's sentryType
the sentry's full name
Gets any existing sentry with the given name or, if none exists, adds the given sentry.
Gets any existing sentry with the given name or, if none exists, adds the given sentry.
type of the sentry
the sentry to add
the class that owns the sentry
name of the sentry
sentryType type of sentry
either the existing sentry or sentry
Returns a new scala.collection.mutable.ConcurrentMap implementation.
Returns a new scala.collection.mutable.ConcurrentMap implementation. Subclass this to do weird things with your own SentriesRegistry implementation.
a new scala.collection.mutable.ConcurrentMap
Removes a SentriesRegistryListener from this registry's collection of listeners.
Removes a SentriesRegistryListener from this registry's collection of listeners.
the listener that will be removed
Removes the sentry with the given name.
Removes the sentry with the given name.
the name of the sentry
Removes the sentry for the given class with the given name (and sentryType).
Removes the sentry for the given class with the given name (and sentryType).
the class that owns the sentry
the name of the sentry
the sentryType of the sentry
Reset all known sentries to their initial state by calling [Sentry#reset] on each sentry.
Reset all known sentries to their initial state by calling [Sentry#reset] on each sentry.
This is can be useful during tests where you want to be sure all sentries start in their initial state. Note: not all sentries support the [Sentry#reset] method. In particular the concurrency limiting sentry does not support this.
A registry of sentry instances.