Documentation ¶
Overview ¶
Package utils提供了stats上报功能
Background ¶
目前公司内部很多监控都基于open-faclon使用,为了让业务更加方便简洁的使用这块功能, 基础库了一个stat的基础组件,用于程序内直接上报统计。
设计文档: http://wiki.inkept.cn/pages/viewpage.action?pageId=14815580
Index ¶
- Constants
- func AddSBatchuccCode(codeMap map[int]int)
- func AddSuccCode(code int)
- func EndStat(st *StatEntry, category string, code int)
- func GetLocalIP() ([]string, error)
- func ReportEvent(event, category string, start, end time.Time, code int)
- func ReportEventGauge(name string, value int, tags ...interface{})
- func ReportServiceEvent(client, event, category string, start, end time.Time, code int)
- func SetStat(stFileName, stMetric string)
- type StatEntry
Constants ¶
View Source
const (
SUCC_CODE int = 0
)
Variables ¶
This section is empty.
Functions ¶
func AddSBatchuccCode ¶
func AddSuccCode ¶
func AddSuccCode(code int)
func ReportEvent ¶
ReportEvent 直接上报一条统计信息
func ReportEventGauge ¶
func ReportServiceEvent ¶
ReportServiceEvent 直接上报一条统计信息
Types ¶
type StatEntry ¶
type StatEntry struct {
// contains filtered or unexported fields
}
stats对象, 这个对象提供了一些方法用来上报数据
func NewServiceStatEntry ¶
在rpc-go内部使用的函数
func NewStatEntry ¶
NewStatEntry开始一个statEntry实例, 参数为需要监控的metric信息的首部.
Click to show internal directories.
Click to hide internal directories.