Add a gauge function, which is used to sample instantaneous values.
Reset all collected stats and erase the history.
Reset all collected stats and erase the history. Probably only useful for unit tests.
Remove a gauge from the provided stats.
Clear an existing label.
Get the Counter object representing a named counter.
Summarize all the counters in this collection.
Get the current value of a named gauge.
Summarize all the gauges in this collection.
Get the current value of a named label, if it exists.
Summarize all the labels in this collection.
Get the Metric object representing a named metric.
Summarize all the metrics in this collection.
Set a label to a string.
Adds a set of values to a named metric.
Adds a set of values to a named metric. Effectively the incoming distribution is merged with the named metric.
Adds a value to a named metric, which tracks min, max, mean, and a histogram.
Summarize all the counters, metrics, gauges, and labels in this collection.
Increments a counter by one, returning the new value.
Increments a counter, returning the new value.
Set a gauge to a specific value.
Set a gauge to a specific value. This overwrites any previous value or function.
Runs the function f and logs that duration, in milliseconds, with the given name.
Runs the function f and logs that duration until the future is satisfied, in microseconds, with the given name.
Lazily runs the Future that f
returns and measure the duration of Future creation and time
until it is satisfied, in milliseconds, with the given name
Runs the function f and logs that duration until the future is satisfied, in nanoseconds, with the given name.
Runs the function f and logs that duration, in microseconds, with the given name.
Runs the function f and logs that duration, in nanoseconds, with the given name.
Runs the function f and logs that duration until the future is satisfied, in milliseconds, with the given name.
Runs the function f and logs that duration until the future is satisfied, in milliseconds, with the given name.
Use timeFutureMillisLazy instead
Trait for anything that collects counters, timings, and gauges, and can report them in name/value maps.
Many helper methods are provided, with default implementations that just call back into the abstract methods, so a concrete implementation only needs to fill in the abstract methods.
To recap the README:
- counter: a value that never decreases (like "exceptions" or "completed_transactions") - gauge: a discrete instantaneous value (like "heap_used" or "current_temperature") - metric: a distribution (min, max, median, 99th percentile, ...) like "event_timing" - label: an instantaneous informational string for debugging or status checking