Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AggrMethodType ¶
type AggrMethodType string
聚合方法
const AggrAvg AggrMethodType = "avg" //求平均
const AggrLast AggrMethodType = "last" //取最后
const AggrSum AggrMethodType = "sum" //求和
type IOpStatistical ¶
type IOpStatistical interface { IStatistical RegIndicator(IIndicator) //注册指标器 }
统计器接口
type IStatistical ¶
type IStatistical interface {
Push(name string, value float64, opts ...StsOpt) IStatistical
}
统计器接口
type IndicAggrMethod ¶ added in v1.1.46
type IndicAggrMethod string
const ( AggrByCount IndicAggrMethod = "count" //求和 AggrBySum IndicAggrMethod = "sum" //求和 AggrByAvg IndicAggrMethod = "avg" //求平均 AggrByMax IndicAggrMethod = "max" //求最大值 AggrByMin IndicAggrMethod = "min" //最小值 )
type IndicData ¶
type IndicData struct { Name string Value float64 Unit string AggrMethod IndicAggrMethod //聚合方式 AggrScope time.Duration //聚合时间范围,最小单位为秒 Labels map[string]string //标签 Time int64 //指标对应时间,单位:毫秒级时间戳 }
IndicData 单个指标数据
func (IndicData) EntireLabels ¶ added in v1.1.46
type LogIndicator ¶
type LogIndicator struct {
// contains filtered or unexported fields
}
func NewLogIndicator ¶
func NewLogIndicator(l v1log.ILog, tags ...string) *LogIndicator
NewLogIndicator 指标上报器-日志
type OpStatistical ¶
统计器
func NewOpStatistical ¶
func NewOpStatistical(label string, interval int64) *OpStatistical
func (*OpStatistical) Start ¶
func (st *OpStatistical) Start()
type TickerAggrIndicator ¶ added in v1.1.46
type TickerAggrIndicator struct {
// contains filtered or unexported fields
}
TickerAggrIndicator 定时聚合上报indicator
func NewTickerAggrIndicator ¶ added in v1.1.46
func NewTickerAggrIndicator(indicators ...IIndicator) *TickerAggrIndicator
NewTickerAggrIndicator 指标上报器-日志
func (*TickerAggrIndicator) Report ¶ added in v1.1.46
func (ind *TickerAggrIndicator) Report(data IndicData)
Report 上报数据
Click to show internal directories.
Click to hide internal directories.