Documentation ¶
Index ¶
- type Counter
- func (c *Counter) Clear()
- func (c *Counter) Count() int64
- func (c *Counter) ExportMetric() *metrics.MetricData
- func (c *Counter) GetMetadata() metrics.Metadata
- func (c *Counter) GetType() metrics.MetricType
- func (c *Counter) Inc(i int64)
- func (c *Counter) Inspect(f func(metrics.Metric))
- func (c *Counter) Snapshot() *Counter
- type CounterRate
- type Gauge
- func (g *Gauge) Dec(i int64)
- func (g *Gauge) ExportMetric() *metrics.MetricData
- func (g *Gauge) GetMetadata() metrics.Metadata
- func (g *Gauge) GetType() metrics.MetricType
- func (g *Gauge) Inc(i int64)
- func (g *Gauge) Inspect(f func(metrics.Metric))
- func (g *Gauge) Snapshot() *Gauge
- func (g *Gauge) Update(v int64)
- func (g *Gauge) Value() int64
- type GaugeFloat64
- func (g *GaugeFloat64) ExportMetric() *metrics.MetricData
- func (g *GaugeFloat64) GetMetadata() metrics.Metadata
- func (g *GaugeFloat64) GetType() metrics.MetricType
- func (g *GaugeFloat64) Inspect(f func(metrics.Metric))
- func (g *GaugeFloat64) Snapshot() *GaugeFloat64
- func (g *GaugeFloat64) Update(v float64)
- func (g *GaugeFloat64) Value() float64
- type Histogram
- func (h *Histogram) ExportMetric() *metrics.MetricData
- func (h *Histogram) GetMetadata() metrics.Metadata
- func (h *Histogram) GetType() metrics.MetricType
- func (h *Histogram) Inspect(f func(metrics.Metric))
- func (h *Histogram) Min() (min int64)
- func (h *Histogram) RecordValue(v int64)
- func (h *Histogram) Snapshot() (hist *hdrhistogram.Histogram)
- func (h *Histogram) TotalCount() (count int64)
- func (h *Histogram) Windowed() (hist *hdrhistogram.Histogram, duration time.Duration)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Counter ¶
A Counter holds a single mutable atomic value.
Can be used to record indicator types that will only increase and not decrease.
func (*Counter) ExportMetric ¶
func (c *Counter) ExportMetric() *metrics.MetricData
ExportMetric returns a filled-in metric data of the right type for the given metric.
func (*Counter) GetMetadata ¶
GetMetadata return the metadata of Counter.
func (*Counter) GetType ¶
func (c *Counter) GetType() metrics.MetricType
GetType returns the type enum for this metric.
type CounterRate ¶
type CounterRate struct { Counter // contains filtered or unexported fields }
CounterRate is a wrapper around a counter.
func NewCounterRate ¶
func NewCounterRate(metadata metrics.Metadata) *CounterRate
NewCounterRate creates a CounterRate.
func (*CounterRate) ExportMetric ¶
func (c *CounterRate) ExportMetric() *metrics.MetricData
ExportMetric returns a filled-in metric data of the right type for the given metric.
func (*CounterRate) GetType ¶
func (c *CounterRate) GetType() metrics.MetricType
GetType returns the type enum for this metric.
type Gauge ¶
Gauge atomically stores a single integer value.
An incremental and subtractable dashboard
func (*Gauge) ExportMetric ¶
func (g *Gauge) ExportMetric() *metrics.MetricData
ExportMetric returns a filled-in metric data of the right type for the given metric.
func (*Gauge) GetMetadata ¶
GetMetadata return the metadata of Gauge.
func (*Gauge) GetType ¶
func (g *Gauge) GetType() metrics.MetricType
GetType returns the type enum for this metric.
type GaugeFloat64 ¶
A GaugeFloat64 atomically stores a single float64 value.
func NewGaugeFloat64 ¶
func NewGaugeFloat64(metadata metrics.Metadata) *GaugeFloat64
NewGaugeFloat64 creates a GaugeFloat64.
func (*GaugeFloat64) ExportMetric ¶
func (g *GaugeFloat64) ExportMetric() *metrics.MetricData
ExportMetric returns a filled-in metric data of the right type for the given metric.
func (*GaugeFloat64) GetMetadata ¶
func (g *GaugeFloat64) GetMetadata() metrics.Metadata
GetMetadata return the metadata of Gauge.
func (*GaugeFloat64) GetType ¶
func (g *GaugeFloat64) GetType() metrics.MetricType
GetType returns the type enum for this metric.
func (*GaugeFloat64) Inspect ¶
func (g *GaugeFloat64) Inspect(f func(metrics.Metric))
Inspect calls the closure with the empty string and the receiver.
func (*GaugeFloat64) Snapshot ¶
func (g *GaugeFloat64) Snapshot() *GaugeFloat64
Snapshot returns a read-only copy of the gauge.
func (*GaugeFloat64) Update ¶
func (g *GaugeFloat64) Update(v float64)
Update updates the gauge's value.
func (*GaugeFloat64) Value ¶
func (g *GaugeFloat64) Value() float64
Value returns the gauge's current value.
type Histogram ¶
Histogram collects observed values by keeping bucketed counts. There are two sets of buckets: A cumulative set and a windowed set. Recording a value in excess of the maxVal results in recording the maxVal instead.
Used primarily to record size or number of events occurring within a specified distribution range (Buckets).
func NewHistogram ¶
func NewHistogram(metadata metrics.Metadata, duration time.Duration, maxVal int64, sigFigs int) *Histogram
NewHistogram initializes a given Histogram. The window histogram rotates every 'duration'; both the windowed and the cumulative histogram track nonnegative values up to 'maxVal' with 'sigFigs' decimal points of precision.
func NewHistogramLatency ¶
NewHistogramLatency is a convenience function which returns a histogram with suitable defaults for latency tracking.
func (*Histogram) ExportMetric ¶
func (h *Histogram) ExportMetric() *metrics.MetricData
ExportMetric returns a filled-in metric data of the right type for the given metric.
func (*Histogram) GetMetadata ¶
GetMetadata return the metadata of Histogram
func (*Histogram) GetType ¶
func (h *Histogram) GetType() metrics.MetricType
GetType returns the type enum for this metric.
func (*Histogram) RecordValue ¶
RecordValue adds the given value to the histogram.
func (*Histogram) Snapshot ¶
func (h *Histogram) Snapshot() (hist *hdrhistogram.Histogram)
Snapshot returns a copy of the cumulative histogram data.
func (*Histogram) TotalCount ¶
TotalCount returns the (cumulative) number of samples.