Creates a Gauge of the given name
.
Creates a Gauge of the given name
.
Clears all registered counters, gauges and stats.
Clears all registered counters, gauges and stats.
this is not atomic. If new metrics are added while this method is executing, those metrics may remain.
Creates a ReadableCounter of the given name
.
Creates a ReadableCounter of the given name
.
Get a counter with the given name
.
Get a counter with the given name
.
This method is a convenience for Java programs, but is no longer needed because StatsReceivers.counter is usable from java.
Accurately indicates if this is a NullStatsReceiver.
Accurately indicates if this is a NullStatsReceiver. Because equality is not forwarded via scala.Proxy, this is helpful to check for a NullStatsReceiver.
Dumps this in-memory stats receiver to the given PrintStream.
Register a function f
as a gauge with the given name that has
a lifecycle with no end.
Register a function f
as a gauge with the given name that has
a lifecycle with no end.
This measurement exists in perpetuity.
Measurements under the same name are added together.
StatsReceiver.addGauge if you can properly control the lifecycle of the returned gauge.
Specifies the representative receiver.
Specifies the representative receiver. This is in order to expose an object we can use for comparison so that global stats are only reported once per receiver.
Prepend namespace
and namespaces
to the names of the returned StatsReceiver.
Prepend namespace
and namespaces
to the names of the returned StatsReceiver.
For example:
statsReceiver.scope("client", "backend", "pool").counter("adds")
will generate a counter named /client/backend/pool/adds
.
Prepend namespace
to the names of the returned StatsReceiver.
Prepend namespace
to the names of the returned StatsReceiver.
For example:
statsReceiver.scope("client").counter("adds") statsReceiver.scope("client").scope("backend").counter("adds")
will generate counters named /client/adds
and /client/backend/adds
.
Prepend a suffix value to the next scope.
Prepend a suffix value to the next scope.
For example:
statsReceiver.scopeSuffix("toto").scope("client").counter("adds")
will generate a counter named /client/toto/adds
.
Creates a ReadableStat of the given name
.
Creates a ReadableStat of the given name
.
Get a stat with the given name.
Get a stat with the given name. This method is a convenience for Java programs, but is no longer needed because StatsReceivers.counter is usable from java.
An in-memory implementation of StatsReceiver, which is mostly used for testing.
Note that an InMemoryStatsReceiver does not conflate
Seq("a", "b")
andSeq("a/b")
names no matter how they look when printed.