Versions in this module Expand all Collapse all v0 v0.0.2 Nov 2, 2023 v0.0.1 Nov 2, 2023 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 Iterator struct + func (i *Iterator) Bucket() Bucket + func (i *Iterator) Next() bool + type Metric interface + Add func(int64) + Value func() int64 + type Options struct + Size int + 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 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 Window struct + func NewWindow(opts Options) *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(offset int, count int) + func (w *Window) ResetWindow() + func (w *Window) Size() int