Versions in this module Expand all Collapse all v0 v0.6.2 Aug 10, 2020 Changes in this version + func Avg(iterator Iterator) float64 + func Count(iterator Iterator) float64 + func Max(iterator Iterator) float64 + func Min(iterator Iterator) float64 + func Sum(iterator Iterator) float64 + type Aggregation interface + Avg func() float64 + Max func() float64 + Min func() float64 + Sum func() float64 + type Bucket struct + Count int64 + Points []float64 + func (b *Bucket) Add(offset int, val float64) + func (b *Bucket) Append(val float64) + func (b *Bucket) Next() *Bucket + func (b *Bucket) Reset() + type Counter interface + func NewCounter(opts CounterOpts) Counter + type CounterOpts Opts + type CounterVec interface + Add func(v float64, labels ...string) + Inc func(labels ...string) + func NewBusinessMetricCount(name string, labels ...string) CounterVec + func NewCounterVec(cfg *CounterVecOpts) CounterVec + type CounterVecOpts VectorOpts + type Gauge interface + Set func(int64) + func NewGauge(opts GaugeOpts) Gauge + type GaugeOpts Opts + type GaugeVec interface + Add func(v float64, labels ...string) + Inc func(labels ...string) + Set func(v float64, labels ...string) + func NewBusinessMetricGauge(name string, labels ...string) GaugeVec + func NewGaugeVec(cfg *GaugeVecOpts) GaugeVec + type GaugeVecOpts VectorOpts + type HistogramVec interface + Observe func(v int64, labels ...string) + func NewBusinessMetricHistogram(name string, buckets []float64, labels ...string) HistogramVec + func NewHistogramVec(cfg *HistogramVecOpts) HistogramVec + type HistogramVecOpts struct + Buckets []float64 + Help string + Labels []string + Name string + Namespace string + Subsystem string + type Iterator struct + func (i *Iterator) Bucket() Bucket + func (i *Iterator) Next() bool + type Metric interface + Add func(int64) + Value func() int64 + type Opts struct + type PointGauge interface + Reduce func(func(Iterator) float64) float64 + func NewPointGauge(opts PointGaugeOpts) PointGauge + type PointGaugeOpts struct + Size int + type PointPolicy struct + func NewPointPolicy(window *Window) *PointPolicy + func (p *PointPolicy) Append(val float64) + func (p *PointPolicy) Reduce(f func(Iterator) float64) float64 + type RollingCounter interface + Reduce func(func(Iterator) float64) float64 + Timespan func() int + func NewRollingCounter(opts RollingCounterOpts) RollingCounter + type RollingCounterOpts struct + BucketDuration time.Duration + Size int + type RollingGauge interface + Reduce func(func(Iterator) float64) float64 + func NewRollingGauge(opts RollingGaugeOpts) RollingGauge + type RollingGaugeOpts struct + BucketDuration time.Duration + Size int + type RollingPolicy struct + func NewRollingPolicy(window *Window, opts RollingPolicyOpts) *RollingPolicy + func (r *RollingPolicy) Add(val float64) + func (r *RollingPolicy) Append(val float64) + func (r *RollingPolicy) Reduce(f func(Iterator) float64) (val float64) + type RollingPolicyOpts struct + BucketDuration time.Duration + type VectorOpts struct + Help string + Labels []string + Name string + Namespace string + Subsystem string + type Window struct + func NewWindow(opts WindowOpts) *Window + func (w *Window) Add(offset int, val float64) + func (w *Window) Append(offset int, val float64) + func (w *Window) Bucket(offset int) Bucket + func (w *Window) Iterator(offset int, count int) Iterator + func (w *Window) ResetBucket(offset int) + func (w *Window) ResetBuckets(offsets []int) + func (w *Window) ResetWindow() + func (w *Window) Size() int + type WindowOpts struct + Size int