Documentation ¶
Overview ¶
Package metrics is for maintaining async-safe dict of named values with extra associated with them parameters. A common example is SDK call execution times stored and accessed by method names.
Index ¶
Constants ¶
const One = 1
One is a constant to be used in MetricsIncrement / MetricsDecrement calls
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Collector ¶ added in v0.8.0
type Collector struct {
// contains filtered or unexported fields
}
Collector is a main object that stores the values and provides methods for setting and retrieving them,
func NewCollector ¶ added in v0.8.0
func NewCollector() *Collector
NewCollector creates and starts a single Collector instance. Instance goroutine is supposed to run thorough the whole lifetime of a program. Multiple independent Collector instances can be run.
func (*Collector) GetMetricsValue ¶ added in v0.8.0
GetMetricsValue returns a current value for a named parameter.
func (*Collector) MetricsDecrement ¶ added in v0.8.0
MetricsDecrement decreases a named metric for a given value. If a named metric does not exists, it is created and set to 0.
func (*Collector) MetricsIncrement ¶ added in v0.8.0
MetricsIncrement increases a named metric for a given value. If a named metric does not exists, it is created and set to 0.
func (*Collector) SetMetricsValue ¶ added in v0.8.0
SetMetricsValue allows to set a named item value, including extra parameters, such as SDK call parameters.