alarm_manager

package
v1.1.7 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package alarm_manager

Package alarm_manager

Package alarm_manager

Package alarm_manager

Index

Constants

View Source
const (
	TopN           = 10
	AlarmManager   = "[Alarm Manager]"
	AlarmSizeLimit = 50 // 超过50开始删除
	AlarmSizeTrim  = 20 // 保留最近的20条
)

Variables

This section is empty.

Functions

func ClearAlarmLimit added in v1.1.2

func ClearAlarmLimit() error

ClearAlarmLimit 告警清除任务 满足条件 数量大于指定条数 则删除最旧的M条

func DeleteAlarm

func DeleteAlarm(id string) error

DeleteAlarm 根据告警id删除告警信息

Types

type Alarm

type Alarm struct {
	mgm.DefaultModel `bson:",inline"`
	Title            string `json:"title" bson:"title"`
	Level            string `json:"level" bson:"level"`
	Message          string `json:"message" bson:"message"`
}

func GetAlarmInfo

func GetAlarmInfo(id string) Alarm

func GetAllAlarm

func GetAllAlarm() []Alarm

GetAllAlarm 获取全部告警信息 按照时间排序 从新到旧

func GetTopNAlarm

func GetTopNAlarm() []Alarm

GetTopNAlarm 获取最新的10条告警

func (*Alarm) CollectionName

func (app *Alarm) CollectionName() string

Jump to

Keyboard shortcuts

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