Documentation ¶
Index ¶
- 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
- type Bucket
- type Iterator
- type Metric
- type RollingCounter
- type RollingPolicy
- type 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
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Aggregation ¶
Aggregation 聚合接口
type Iterator ¶
type Iterator struct {
// contains filtered or unexported fields
}
Iterator 迭代窗口中所有桶
type Metric ¶
type Metric interface { // Add 将给定值添加到当前窗口 Add(int64) // Value 获取当前值 // 如果是 类型是 PointGauge, RollingCounter, RollingGauge // 返回窗口总和 Value() int64 }
Metric 简单实现 度量标准软件包中度量标准的实现是:Counter, Gauge,PointGauge, RollingCounter and RollingGauge.
type RollingCounter ¶
type RollingCounter interface { Metric Aggregation Timespan() int // Reduce 将缩减功能应用于窗口内的所有存储桶。 Reduce(func(Iterator) float64) float64 }
RollingCounter 滚动窗口接口
func NewRollingCounter ¶
func NewRollingCounter(size int, bucketDuration time.Duration) RollingCounter
NewRollingCounter 实例化 RollingCounter 方法
type RollingPolicy ¶
type RollingPolicy struct {
// contains filtered or unexported fields
}
RollingPolicy 基于持续时间的环形窗口的策略,随时间段移动存储桶偏移量。
func NewRollingPolicy ¶
func NewRollingPolicy(window *Window, bucketDuration time.Duration) *RollingPolicy
NewRollingPolicy 实例化 RollingPolicy 对象
Click to show internal directories.
Click to hide internal directories.