Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Counter ¶
type Counter interface { // 调用 With 方法后,statsd.Counter 会被重新实例化,原来的 Namer 和 Statsd 就都没了。 // type Counter struct { // Counter *statsd.Counter // namer *internal.Namer // statsdProvider *statsd.Statsd // } // func (c *Counter) With(labelValues ...string) metrics.Counter { // name := c.namer.Format(labelValues...) // return &Counter{Counter: c.statsdProvider.NewCounter(name, 1)} // } With(labelValues ...string) Counter Add(delta float64) }
type CounterOpts ¶
type Gauge ¶
type Gauge interface { // 调用 With 方法后,statsd.Gauge 会被重新实例化,原来的 Namer 和 Statsd 就都没了。 // type Gauge struct { // Gauge *statsd.Gauge // namer *internal.Namer // statsdProvider *statsd.Statsd // } // func (g *Gauge) With(labelValues ...string) metrics.Gauge { // name := g.namer.Format(labelValues...) // return &Gauge{Gauge: g.statsdProvider.NewGauge(name)} // } With(labelValues ...string) Gauge Add(delta float64) Set(value float64) }
Gauge 量表
type Histogram ¶
type Histogram interface { // 调用 With 方法后,statsd.Timing 会被重新实例化,原来的 Namer 和 Statsd 就都没了。 // type Histogram struct { // Timing *statsd.Timing // namer *internal.Namer // statsdProvider *statsd.Statsd // } // func (h *Histogram) With(labelValues ...string) metrics.Histogram { // name := h.namer.Format(labelValues...) // return &Histogram{Timing: h.statsdProvider.NewTiming(name, 1)} // } With(labelValues ...string) Histogram Observe(value float64) }
Histogram 柱状图
type HistogramOpts ¶
type Provider ¶
type Provider interface { NewCounter(CounterOpts) Counter NewGauge(GaugeOpts) Gauge NewHistogram(HistogramOpts) Histogram }
Click to show internal directories.
Click to hide internal directories.