Documentation
¶
Index ¶
- Constants
- Variables
- func DeepCopyStringMap(p map[string]string) map[string]string
- func GetCollects()
- func GetCollectsRetry() (model.Collect, error)
- func GetPatAndTimeFormat(tf string) (string, string)
- func GetPortCollects() map[int]*model.PortCollect
- func GetProcCollects() map[string]*model.ProcCollect
- func Init(stra StraSection)
- func NewPortCollect(port, step int, tags string) *model.PortCollect
- func NewProcCollect(method, name, tags string, step int) *model.ProcCollect
- type CollectResp
- type StraSection
- type Strategy
Constants ¶
View Source
const PATTERN_EXCLUDE_PARTITION = "```EXCLUDE```"
Variables ¶
View Source
var Collect model.Collect
Functions ¶
func GetCollects ¶
func GetCollects()
func GetCollectsRetry ¶
func GetPatAndTimeFormat ¶
func GetPortCollects ¶
func GetPortCollects() map[int]*model.PortCollect
func GetProcCollects ¶
func GetProcCollects() map[string]*model.ProcCollect
func Init ¶
func Init(stra StraSection)
func NewPortCollect ¶
func NewPortCollect(port, step int, tags string) *model.PortCollect
func NewProcCollect ¶
func NewProcCollect(method, name, tags string, step int) *model.ProcCollect
Types ¶
type CollectResp ¶
type StraSection ¶
type StraSection struct {
Enable bool `yaml:"enable"`
Interval int `yaml:"interval"`
Api string `yaml:"api"`
Timeout int `yaml:"timeout"`
PortPath string `yaml:"portPath"`
ProcPath string `yaml:"procPath"`
LogPath string `yaml:"logPath"`
}
var StraConfig StraSection
type Strategy ¶
type Strategy struct {
ID int64 `json:"id"`
Name string `json:"name"` //监控策略名
FilePath string `json:"file_path"` //文件路径
TimeFormat string `json:"time_format"` //时间格式
Pattern string `json:"pattern"` //表达式
Exclude string `json:"-"`
MeasurementType string `json:"measurement_type"`
Interval int64 `json:"interval"` //采集周期
Tags map[string]string `json:"tags"`
Func string `json:"func"` //采集方式(max/min/avg/cnt)
Degree int64 `json:"degree"`
Unit string `json:"unit"`
Comment string `json:"comment"`
Creator string `json:"creator"`
SrvUpdated string `json:"updated"`
LocalUpdated int64 `json:"-"`
TimeReg *regexp.Regexp `json:"-"`
PatternReg *regexp.Regexp `json:"-"`
ExcludeReg *regexp.Regexp `json:"-"`
TagRegs map[string]*regexp.Regexp `json:"-"`
ParseSucc bool `json:"parse_succ"`
}
func GetCollectFromFile ¶
func GetLogCollects ¶
func GetLogCollects() []*Strategy
func ToStrategy ¶
func ToStrategy(p *model.LogCollect) *Strategy
Click to show internal directories.
Click to hide internal directories.