github.com/songzhibin97/gkit@v1.2.13/internal/stat/metric.go (about)

     1  package stat
     2  
     3  // Metric 简单实现
     4  // 度量标准软件包中度量标准的实现是:Counter, Gauge,PointGauge, RollingCounter and RollingGauge.
     5  type Metric interface {
     6  	// Add 将给定值添加到当前窗口
     7  	Add(int64)
     8  
     9  	// Value 获取当前值
    10  	// 如果是 类型是 PointGauge, RollingCounter, RollingGauge
    11  	// 返回窗口总和
    12  	Value() int64
    13  }
    14  
    15  // Aggregation 聚合接口
    16  type Aggregation interface {
    17  	Min() float64
    18  	Max() float64
    19  	Avg() float64
    20  	Sum() float64
    21  }