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: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FieldKeyFormat = "%d_%d_%d" //监控规则配置的Redis key中的field格式
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Dao

type Dao struct {
	// contains filtered or unexported fields
}

Dao is redis dao.

func New

func New(c *conf.Config) (d *Dao)

New new a archive dao.

func (*Dao) BusStatsKeys

func (d *Dao) BusStatsKeys(c context.Context, bid int8) (prefix string, keys []string, err error)

BusStatsKeys 获取某业务统计的所有keys

func (*Dao) Close

func (d *Dao) Close()

Close close dao.

func (*Dao) GetAllRules

func (d *Dao) GetAllRules(c context.Context, all bool) (rules []*monitor.Rule, err error)

GetAllRules 获取所有规则

func (*Dao) GetRule

func (d *Dao) GetRule(c context.Context, tp, bid int8, id int64) (rule *monitor.Rule, err error)

GetRule 获取某条监控规则

func (*Dao) GetRules

func (d *Dao) GetRules(c context.Context, tp, bid int8, all bool) (rules []*monitor.Rule, err error)

GetRules 获取业务下的规则

func (*Dao) RemMonitorStats

func (d *Dao) RemMonitorStats(c context.Context, key string, oid int64) (err error)

RemMonitorStats remove stay stats

func (*Dao) RuleIDIncKey

func (d *Dao) RuleIDIncKey(c context.Context) (id int64, err error)

RuleIDIncKey 自增配置id

func (*Dao) SetRule

func (d *Dao) SetRule(c context.Context, rule *monitor.Rule) (err error)

SetRule 修改/添加监控规则

func (*Dao) SetRuleState

func (d *Dao) SetRuleState(c context.Context, tp, bid int8, id int64, state int8) (err error)

SetRuleState 修改监控规则的状态

func (*Dao) StatsResult

func (d *Dao) StatsResult(c context.Context, key string, conf *monitor.RuleConf) (res *monitor.Stats, err error)

StatsResult 获取稿件停留统计

func (*Dao) StayOids

func (d *Dao) StayOids(c context.Context, rule *monitor.Rule, keys []string) (oidMap map[int64]int, total int, err error)

StayOids 获取多个key 中的滞留oid

Jump to

Keyboard shortcuts

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