statsd

package
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 26, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Counter

type Counter struct {
	Counter *statsd.Counter
	// contains filtered or unexported fields
}

func (*Counter) Add

func (c *Counter) Add(delta float64)

func (*Counter) With

func (c *Counter) With(labelValues ...string) metrics.Counter

type Gauge

type Gauge struct {
	Gauge *statsd.Gauge
	// contains filtered or unexported fields
}

func (*Gauge) Add

func (g *Gauge) Add(delta float64)

func (*Gauge) Set

func (g *Gauge) Set(value float64)

func (*Gauge) With

func (g *Gauge) With(labelValues ...string) metrics.Gauge

type Histogram

type Histogram struct {
	Timing *statsd.Timing
	// contains filtered or unexported fields
}

func (*Histogram) Observe

func (h *Histogram) Observe(value float64)

func (*Histogram) With

func (h *Histogram) With(labelValues ...string) metrics.Histogram

type Provider

type Provider struct {
	Statsd *statsd.Statsd
}

func (*Provider) NewCounter

func (p *Provider) NewCounter(opts metrics.CounterOpts) metrics.Counter

NewCounter 新建一个Counter,如果opts里的LabelNames是空的,则暂时不会创建statsd的Counter, 所以将来调用Add方法会因为空指针调用而panic,所以想避免该错误,则必须在调用Add方法之前,先调 用With方法。 注意:往With方法里传入的labelValues,所有的labels必须是LabelNames里所包含的,不然会panic。

func (*Provider) NewGauge

func (p *Provider) NewGauge(opts metrics.GaugeOpts) metrics.Gauge

NewGauge 新建一个Gauge,如果opts里的LabelNames是空的,则暂时不会创建statsd的Gauge, 所以将来调用Set或Add方法会因为空指针调用而panic,所以想避免该错误,则必须在调用Set或 Add方法之前,先调用With方法。 注意:往With方法里传入的labelValues,所有的labels必须是LabelNames里所包含的,不然会panic。

func (*Provider) NewHistogram

func (p *Provider) NewHistogram(opts metrics.HistogramOpts) metrics.Histogram

NewHistogram 新建一个Histogram,如果opts里的LabelNames是空的,则暂时不会创建statsd的Histogram, 所以将来调用Observe方法会因为空指针调用而panic,所以想避免该错误,则必须在调用Observe方法之前,先 调用With方法。 注意:往With方法里传入的labelValues,所有的labels必须是LabelNames里所包含的,不然会panic。

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL