monitor

package
v0.0.0-...-83adff0 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2020 License: GPL-3.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// RedisPrefix 参数:business。
	RedisPrefix = "monitor_stats_%d_"
	// SuffixVideo 视频停留统计。参数:state
	SuffixVideo = "%d"
	// SuffixArc 稿件停留统计。参数:round。参数:state。
	SuffixArc = "%d_%d"
	BusVideo  = 1
	BusArc    = 2

	NotifyTypeEmail = 1
	NotityTypeSms   = 2

	RuleStateOK      = 1
	RuleStateDisable = 0
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Rule

type Rule struct {
	ID       int64     `json:"id"`
	Type     int8      `json:"type"`
	Business int8      `json:"business"`
	Name     string    `json:"name"`
	State    int8      `json:"state"`
	STime    string    `json:"s_time"`
	ETime    string    `json:"e_time"`
	RuleConf *RuleConf `json:"rule_conf"`
}

Rule 监控规则信息

type RuleConf

type RuleConf struct {
	Name    string `json:"name"`
	MoniCdt map[string]struct {
		Comp  string `json:"comparison"`
		Value int64  `json:"value"`
	} `json:"moni_cdt"`
	NotifyCdt map[string]struct {
		Comp  string `json:"comparison"`
		Value int64  `json:"value"`
	} `json:"notify_cdt"`
	Notify struct {
		Way    int8     `json:"way"`
		Member []string `json:"member"`
	} `json:"notify"`
}

RuleConf 监控方案配置结构体

type RuleResultData

type RuleResultData struct {
	Rule  *Rule  `json:"rule"`
	Stats *Stats `json:"stats"`
}

type RuleResultRes

type RuleResultRes struct {
	Code int               `json:"code"`
	Data []*RuleResultData `json:"data"`
}

type Stats

type Stats struct {
	TotalCount int `json:"total_count"`
	MoniCount  int `json:"moni_count"`
	MaxTime    int `json:"max_time"`
}

Jump to

Keyboard shortcuts

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