Documentation
¶
Index ¶
- Constants
- func GetLineTime(line *string, format *string) (*time.Time, error)
- func Init(cfgFile string)
- func Run()
- func Test(line string)
- type Config
- type GatherFile
- type GatherItem
- type GatherStat
- type GatherWorker
- func (gw *GatherWorker) GatherData(tag_key string, value float64, tagsStat map[string]*GatherStat)
- func (gw *GatherWorker) ParseLine(line *string, regexpLine *regexp.Regexp, regexpTags map[string]*regexp.Regexp, ...) (float64, string, error)
- func (gw *GatherWorker) ReportData(item *GatherItem, tagsStat map[string]*GatherStat)
- func (gw *GatherWorker) SubWorker(ch chan *LogInfo, item *GatherItem)
- func (gw *GatherWorker) Worker()
- type LogInfo
Constants ¶
View Source
const ( ENABLE = 1 DISABLE = 0 )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct {
Enable bool `json:"enable"` //是否启用
Files []GatherFile `json:"files"` //需要采集的文件
}
type GatherFile ¶
type GatherFile struct {
Enable bool `json:"enable"` //是否启用
ReportStep int `json:"report_step"` //上报间隔 默认60s
File string `json:"file"` //文件名
Format string `json:"format"` //时间格式 默认:2006-01-02 15:04:05
Items []GatherItem `json:"items"` //采集项目
}
type GatherItem ¶
type GatherStat ¶
func (*GatherStat) Rest ¶
func (gs *GatherStat) Rest()
type GatherWorker ¶
type GatherWorker struct {
GFile *GatherFile
ReadPos int64
DataChan []chan *LogInfo
MetricChan chan *model.MetricValue
}
func NewGatherWorker ¶
func NewGatherWorker(gf *GatherFile) *GatherWorker
func (*GatherWorker) GatherData ¶
func (gw *GatherWorker) GatherData(tag_key string, value float64, tagsStat map[string]*GatherStat)
搜集数据
func (*GatherWorker) ReportData ¶
func (gw *GatherWorker) ReportData(item *GatherItem, tagsStat map[string]*GatherStat)
上报数据
func (*GatherWorker) SubWorker ¶
func (gw *GatherWorker) SubWorker(ch chan *LogInfo, item *GatherItem)
单指标上报
Click to show internal directories.
Click to hide internal directories.