stra

package
v4.0.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 4, 2021 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const PATTERN_EXCLUDE_PARTITION = "```EXCLUDE```"

Variables

View Source
var Collect models.Collect

Functions

func DeepCopyStringMap

func DeepCopyStringMap(p map[string]string) map[string]string

func GetCollects

func GetCollects()

func GetPatAndTimeFormat

func GetPatAndTimeFormat(tf string) (string, string)

func GetPortCollects

func GetPortCollects() map[int]*models.PortCollect

func GetProcCollects

func GetProcCollects() map[string]*models.ProcCollect

func Init

func Init()

func NewPortCollect

func NewPortCollect(port, step int, tags string, modTime time.Time) *models.PortCollect

func NewProcCollect

func NewProcCollect(method, name, tags string, step int, modTime time.Time) *models.ProcCollect

Types

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"`
	WhetherAttachOneLogLine int                       `json:"whether_attach_one_log_line"`
}

func GetCollectFromFile

func GetCollectFromFile(logPath string) []*Strategy

func GetLogCollects

func GetLogCollects() []*Strategy

func ToStrategy

func ToStrategy(p *models.LogCollect) *Strategy

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL