Documentation ¶
Index ¶
- type Counter
- type CounterVec
- type DurationHistogramVec
- type FuncCounter
- type FuncGauge
- type FuncIntGauge
- type Gauge
- type GaugeVec
- type Histogram
- type HistogramVec
- type IntGauge
- type IntGaugeVec
- type MetricsVector
- type Registry
- func (r Registry) ComposeName(parts ...string) string
- func (r Registry) Counter(name string) metrics.Counter
- func (r *Registry) CounterVec(name string, labels []string) metrics.CounterVec
- func (r Registry) DurationHistogram(name string, buckets metrics.DurationBuckets) metrics.Timer
- func (r *Registry) DurationHistogramVec(name string, buckets metrics.DurationBuckets, labels []string) metrics.TimerVec
- func (r Registry) FuncCounter(name string, function func() int64) metrics.FuncCounter
- func (r Registry) FuncGauge(name string, function func() float64) metrics.FuncGauge
- func (r *Registry) FuncIntGauge(name string, function func() int64) metrics.FuncIntGauge
- func (r Registry) Gauge(name string) metrics.Gauge
- func (r *Registry) GaugeVec(name string, labels []string) metrics.GaugeVec
- func (r Registry) Histogram(name string, buckets metrics.Buckets) metrics.Histogram
- func (r *Registry) HistogramVec(name string, buckets metrics.Buckets, labels []string) metrics.HistogramVec
- func (r *Registry) IntGauge(name string) metrics.IntGauge
- func (r *Registry) IntGaugeVec(name string, labels []string) metrics.IntGaugeVec
- func (r Registry) Timer(name string) metrics.Timer
- func (r *Registry) TimerVec(name string, labels []string) metrics.TimerVec
- func (r Registry) WithPrefix(prefix string) metrics.Registry
- func (r Registry) WithTags(tags map[string]string) metrics.Registry
- type RegistryOpts
- func (o *RegistryOpts) AddTags(tags map[string]string) *RegistryOpts
- func (o *RegistryOpts) AppendPrefix(prefix string) *RegistryOpts
- func (o *RegistryOpts) SetPrefix(prefix string) *RegistryOpts
- func (o *RegistryOpts) SetSeparator(separator rune) *RegistryOpts
- func (o *RegistryOpts) SetTags(tags map[string]string) *RegistryOpts
- type Timer
- type TimerVec
- type Vector
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Counter ¶
Counter tracks monotonically increasing value.
type CounterVec ¶
type CounterVec struct {
Vec MetricsVector
}
CounterVec stores counters and implements metrics.CounterVec interface
type DurationHistogramVec ¶
type DurationHistogramVec struct {
Vec MetricsVector
}
DurationHistogramVec stores duration histograms and implements metrics.TimerVec interface
func (*DurationHistogramVec) Reset ¶
func (v *DurationHistogramVec) Reset()
Reset deletes all metrics in this vector.
type FuncCounter ¶
type FuncCounter struct {
// contains filtered or unexported fields
}
func (FuncCounter) Function ¶
func (c FuncCounter) Function() func() int64
type FuncIntGauge ¶
type FuncIntGauge struct {
// contains filtered or unexported fields
}
func (FuncIntGauge) Function ¶
func (g FuncIntGauge) Function() func() int64
type GaugeVec ¶
type GaugeVec struct {
Vec MetricsVector
}
GaugeVec stores gauges and implements metrics.GaugeVec interface
type Histogram ¶
type Histogram struct { Name string Tags map[string]string BucketBounds []float64 BucketValues []int64 InfValue *atomic.Int64 // contains filtered or unexported fields }
func (*Histogram) RecordDuration ¶
func (*Histogram) RecordValue ¶
type HistogramVec ¶
type HistogramVec struct {
Vec MetricsVector
}
HistogramVec stores histograms and implements metrics.HistogramVec interface
func (*HistogramVec) Reset ¶
func (v *HistogramVec) Reset()
Reset deletes all metrics in this vector.
type IntGaugeVec ¶
type IntGaugeVec struct {
Vec MetricsVector
}
IntGaugeVec stores gauges and implements metrics.IntGaugeVec interface
type MetricsVector ¶
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
func NewRegistry ¶
func NewRegistry(opts *RegistryOpts) *Registry
func (Registry) ComposeName ¶
func (*Registry) CounterVec ¶
func (r *Registry) CounterVec(name string, labels []string) metrics.CounterVec
CounterVec creates a new counters vector with given metric name and partitioned by the given label names.
func (Registry) DurationHistogram ¶
func (*Registry) DurationHistogramVec ¶
func (r *Registry) DurationHistogramVec(name string, buckets metrics.DurationBuckets, labels []string) metrics.TimerVec
DurationHistogramVec creates a new duration histograms vector with given metric name and buckets and partitioned by the given label names.
func (Registry) FuncCounter ¶
func (r Registry) FuncCounter(name string, function func() int64) metrics.FuncCounter
func (*Registry) FuncIntGauge ¶
func (r *Registry) FuncIntGauge(name string, function func() int64) metrics.FuncIntGauge
func (*Registry) GaugeVec ¶
GaugeVec creates a new gauges vector with given metric name and partitioned by the given label names.
func (*Registry) HistogramVec ¶
func (r *Registry) HistogramVec(name string, buckets metrics.Buckets, labels []string) metrics.HistogramVec
HistogramVec creates a new histograms vector with given metric name and buckets and partitioned by the given label names.
func (*Registry) IntGaugeVec ¶
func (r *Registry) IntGaugeVec(name string, labels []string) metrics.IntGaugeVec
IntGaugeVec creates a new gauges vector with given metric name and partitioned by the given label names.
func (*Registry) TimerVec ¶
TimerVec creates a new timers vector with given metric name and partitioned by the given label names.
func (Registry) WithPrefix ¶
WithPrefix creates new sub-scope, where each metric has prefix added to it name.
type RegistryOpts ¶
type RegistryOpts struct { Separator rune Prefix string Tags map[string]string AllowLoadRegisteredMetrics bool }
func NewRegistryOpts ¶
func NewRegistryOpts() *RegistryOpts
NewRegistryOpts returns new initialized instance of RegistryOpts
func (*RegistryOpts) AddTags ¶
func (o *RegistryOpts) AddTags(tags map[string]string) *RegistryOpts
AddTags merges given tags with existing
func (*RegistryOpts) AppendPrefix ¶
func (o *RegistryOpts) AppendPrefix(prefix string) *RegistryOpts
AppendPrefix adds given prefix as postfix to existing using separator
func (*RegistryOpts) SetPrefix ¶
func (o *RegistryOpts) SetPrefix(prefix string) *RegistryOpts
SetPrefix overrides existing prefix
func (*RegistryOpts) SetSeparator ¶
func (o *RegistryOpts) SetSeparator(separator rune) *RegistryOpts
SetSeparator overrides existing separator
func (*RegistryOpts) SetTags ¶
func (o *RegistryOpts) SetTags(tags map[string]string) *RegistryOpts
SetTags overrides existing tags
type TimerVec ¶
type TimerVec struct {
Vec MetricsVector
}
TimerVec stores timers and implements metrics.TimerVec interface