Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct { Metric string //度量名称,比如log.console 或者log Timer int // 每隔多长时间(秒)上报 Host string //主机名称 Agent string //agent api url WatchFiles []WatchFile `json:"files"` LogLevel string }
var (
Cfg *Config
)
func ReadConfig ¶
type PushData ¶
type PushData struct { Metric string `json:"metric"` //统计纬度 Endpoint string `json:"endpoint"` //主机 Timestamp int64 `json:"timestamp"` //unix时间戳,秒 Value float64 `json:"value"` // 代表该metric在当前时间点的值 Step int `json:"step"` // 表示该数据采集项的汇报周期,这对于后续的配置监控策略很重要,必须明确指定。 CounterType string `json:"counterType"` //只能是COUNTER或者GAUGE二选一,前者表示该数据采集项为计时器类型,后者表示其为原值 (注意大小写) //GAUGE:即用户上传什么样的值,就原封不动的存储 //COUNTER:指标在存储和展现的时候,会被计算为speed,即(当前值 - 上次值)/ 时间间隔 Tags string `json:"tags"` //一组逗号分割的键值对, 对metric进一步描述和细化, 可以是空字符串. 比如idc=lg,比如service=xbox等,多个tag之间用逗号分割 }
说明:这7个字段都是必须指定
Click to show internal directories.
Click to hide internal directories.