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。参数1:bid;参数2:监控ID
	RedisPrefix = "monitor_stats_%d"

	// CompGT 大于
	CompGT = ">"
	// CompLT 小于
	CompLT = "<"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Rule

type Rule struct {
	ID       int64     `json:"id"`
	Type     int8      `json:"type"`
	BID      int8      `json:"bid"`
	Name     string    `json:"name"`
	State    int8      `json:"state"`
	STime    string    `json:"stime"`
	ETime    string    `json:"etime"`
	CTime    string    `json:"ctime"`
	MTime    string    `json:"mtime"`
	UID      int64     `json:"uid"`
	RuleConf *RuleConf `json:"rule"`
}

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"`
	User  *User  `json:"user"`
	Stats *Stats `json:"stats"`
}

RuleResultData 返回的结果数据

type Stats

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

Stats 监控统计

type User

type User struct {
	ID       int64  `json:"id"`
	UserName string `json:"username"`
	NickName string `json:"nickname"`
}

User manager user struct

Jump to

Keyboard shortcuts

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