monitoring

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Event

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

Event is the event structure

func NewEvent

func NewEvent(name EventName, params ...interface{}) Event

NewEvent creates a new event

func (Event) GetID

func (e Event) GetID() EventName

GetID returns the event's id

func (Event) GetParam

func (e Event) GetParam(i int) interface{}

GetParam returns the event's parameter

type EventName

type EventName uint

EventName is the name of event

const (
	// IncTotalAlert will show the total incoming alerts
	IncTotalAlert EventName = iota
	// IncTelegramSendSuccess will show the total success telegram sends
	IncTelegramSendSuccess
	// IncTelegramSendFailure will show the total failure telegram sends
	IncTelegramSendFailure
	// IncSquadcastSendSuccess will show the total success squadcast sends
	IncSquadcastSendSuccess
	// IncSquadcastSendFailure will show the total failure squadcast sends
	IncSquadcastSendFailure
	// IncSlackSendSuccess will show the total success squadcast sends
	IncSlackSendSuccess
	// IncSlackSendFailure will show the total failure squadcast sends
	IncSlackSendFailure
	// IncCustomSendSuccess will show the total success squadcast sends
	IncCustomSendSuccess
	// IncCustomSendFailure will show the total failure squadcast sends
	IncCustomSendFailure
	// SetActiveJobsInAlertPool will show the total active jobs in alert pool
	SetActiveJobsInAlertPool
	// SetAlertPoolCapacity will show the total capacity of alert pool
	SetAlertPoolCapacity
)

type MockMonitor

type MockMonitor struct {
}

MockMonitor is a mock monitor

func (MockMonitor) Record

func (i MockMonitor) Record(events []Event)

Record records the events

type Monitor

type Monitor interface {
	Record(events []Event)
}

Monitor is the monitoring interface

func NewMockMonitor

func NewMockMonitor() Monitor

NewMockMonitor creates a new mock monitor

func NewPrometheusMonitor

func NewPrometheusMonitor() Monitor

NewPrometheusMonitor creates a new prometheus monitor

type PrometheusMonitor

type PrometheusMonitor struct {
}

PrometheusMonitor is the prometheus monitor

func (PrometheusMonitor) Record

func (i PrometheusMonitor) Record(events []Event)

Record records the events

Jump to

Keyboard shortcuts

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