package
0.0.0-20240914090759-22fe844ec72e
Repository: https://github.com/couchbase/query.git
Documentation: pkg.go.dev
# Functions
Call the given function for each registered metric.
Get the metric by the given name or nil if none is registered.
Gets an existing metric or creates and registers a new one.
GetOrRegisterCounter returns an existing Counter or constructs and registers a new StandardCounter.
GetOrRegisterGauge returns an existing Gauge or constructs and registers a new StandardGauge.
GetOrRegisterHistogram returns an existing Histogram or constructs and registers a new StandardHistogram.
GetOrRegisterMeter returns an existing Meter or constructs and registers a new StandardMeter.
GetOrRegisterTimer returns an existing Timer or constructs and registers a new StandardTimer.
Register the given metric under the given name.
NewCounter constructs a new StandardCounter.
NewEWMA constructs a new EWMA with the given alpha.
NewEWMA1 constructs a new EWMA for a one-minute moving average.
NewEWMA15 constructs a new EWMA for a fifteen-minute moving average.
NewEWMA5 constructs a new EWMA for a five-minute moving average.
NewExpDecaySample constructs a new exponentially-decaying sample with the given reservoir size and alpha.
NewGauge constructs a new StandardGauge.
NewHistogram constructs a new StandardHistogram from a Sample.
NewMeter constructs a new StandardMeter and launches a goroutine.
NewRegisteredCounter constructs and registers a new StandardCounter.
NewRegisteredGauge constructs and registers a new StandardGauge.
NewRegisteredHistogram constructs and registers a new StandardHistogram from a Sample.
NewMeter constructs and registers a new StandardMeter and launches a goroutine.
NewRegisteredTimer constructs and registers a new StandardTimer.
Create a new registry.
NewTimer constructs a new StandardTimer using an exponentially-decaying sample with the same reservoir size and alpha as UNIX load averages.
Register the given metric under the given name.
Unregister the metric with the given name.
# Variables
No description provided by the author
# Structs
No description provided by the author
StandardCounter is the standard implementation of a Counter and uses the sync/atomic package to manage a single int64 value.
StandardEWMA is the standard implementation of an EWMA and tracks the number of uncounted events and processes them on each tick.
StandardGauge is the standard implementation of a Gauge and uses the sync/atomic package to manage a single int64 value.
StandardHistogram is the standard implementation of a Histogram and uses a Sample to bound its memory use.
StandardMeter is the standard implementation of a Meter.
The standard implementation of a Registry is a mutex-protected map of names to metrics.
StandardTimer is the standard implementation of a Timer and uses a Histogram and Meter.
# Interfaces
Counters hold an int64 value that can be incremented and decremented.
EWMAs continuously calculate an exponentially-weighted moving average based on an outside source of clock ticks.
Gauges hold an int64 value that can be set arbitrarily.
Histograms calculate distribution statistics from a series of int64 values.
Meters count events to produce exponentially-weighted moving average rates at one-, five-, and fifteen-minutes and a mean rate.
A Registry holds references to a set of metrics by name and can iterate over them, calling callback functions provided by the user.
Samples maintain a statistically-significant selection of values from a stream.
Timers capture the duration and rate of events.
# Type aliases
DuplicateMetric is the error returned by Registry.Register when a metric already exists.