Documentation ¶
Index ¶
Constants ¶
View Source
const ( DefaultOtherMaxSize = 100 DefaultSCounterQpsPeriod = 1 )
View Source
const ( MinPositiveFloat64 = 0.000001 MaxNegativeFloat64 = -0.000001 )
internal
Variables ¶
View Source
var ( // 计数统计,正确计数,错误计数, ... RecvCnt = NewSCounterQps("RecvCnt") RpcRecvCnt = NewSCounterQps("RpcRecvCnt") HttpRecvCnt = NewSCounterQps("HttpRecvCnt") SendToJudgeCnt = NewSCounterQps("SendToJudgeCnt") SendToTsDBCnt = NewSCounterQps("SendToTsDBCnt") SendToGraphCnt = NewSCounterQps("SendToGraphCnt") SendToJudgeDropCnt = NewSCounterQps("SendToJudgeDropCnt") SendToTsDBDropCnt = NewSCounterQps("SendToTsDBDropCnt") SendToGraphDropCnt = NewSCounterQps("SendToGraphDropCnt") SendToJudgeFailCnt = NewSCounterQps("SendToJudgeFailCnt") SendToTsDBFailCnt = NewSCounterQps("SendToTsDBFailCnt") SendToGraphFailCnt = NewSCounterQps("SendToGraphFailCnt") // 发送缓存大小 JudgeQueuesCnt = NewSCounterBase("JudgeSendCacheCnt") TsDBQueuesCnt = NewSCounterBase("TsDBSendCacheCnt") GraphQueuesCnt = NewSCounterBase("GraphSendCacheCnt") )
统计指标的整体数据
View Source
var (
RecvDataFilter = NewDataFilter("RecvDataFilter", 5)
)
filter
View Source
var (
RecvDataTrace = NewDataTrace("RecvDataTrace", 3)
)
trace
Functions ¶
Types ¶
type DataFilter ¶
type DataFilter struct { sync.RWMutex MaxSize int Name string PK string Opt string Threshold float64 L *list.List }
func NewDataFilter ¶
func NewDataFilter(name string, maxSize int) *DataFilter
func (*DataFilter) Filter ¶
func (u *DataFilter) Filter(pk string, val float64, v interface{})
proposed that there were few traced items
func (*DataFilter) GetAllFiltered ¶
func (u *DataFilter) GetAllFiltered() []interface{}
type DataTrace ¶
func NewDataTrace ¶
func (*DataTrace) GetAllTraced ¶
func (u *DataTrace) GetAllTraced() []interface{}
type SCounterBase ¶
type SCounterBase struct { sync.RWMutex Name string Cnt int64 Time string Other map[string]interface{} // contains filtered or unexported fields }
basic counter
func NewSCounterBase ¶
func NewSCounterBase(name string) *SCounterBase
func (*SCounterBase) Get ¶
func (u *SCounterBase) Get() *SCounterBase
func (*SCounterBase) Incr ¶
func (u *SCounterBase) Incr()
func (*SCounterBase) IncrBy ¶
func (u *SCounterBase) IncrBy(incr int64)
func (*SCounterBase) PutOther ¶
func (u *SCounterBase) PutOther(key string, value interface{}) bool
func (*SCounterBase) SetCnt ¶
func (u *SCounterBase) SetCnt(cnt int64)
type SCounterQps ¶
type SCounterQps struct { sync.RWMutex Name string Cnt int64 Qps int64 Time string Other map[string]interface{} // contains filtered or unexported fields }
counter with qps
func NewSCounterQps ¶
func NewSCounterQps(name string) *SCounterQps
func (*SCounterQps) Get ¶
func (u *SCounterQps) Get() *SCounterQps
func (*SCounterQps) Incr ¶
func (u *SCounterQps) Incr()
func (*SCounterQps) IncrBy ¶
func (u *SCounterQps) IncrBy(incr int64)
func (*SCounterQps) PutOther ¶
func (u *SCounterQps) PutOther(key string, value interface{}) bool
Click to show internal directories.
Click to hide internal directories.