status

package
v0.2024.4 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2024 License: GPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SummariseRequestErrors

func SummariseRequestErrors(name string, requests []string, errs []error) (gen.StatusLog_Level, string)

func UpdatePollErrorStatus

func UpdatePollErrorStatus(statuses *statuspb.Map, name, task string, requests []string, errs []error)

Types

type Monitor

type Monitor struct {
	Logger *zap.Logger
	// contains filtered or unexported fields
}

func NewMonitor

func NewMonitor(client *gobacnet.Client, known known.Context, status *statuspb.Map) *Monitor

func (*Monitor) AddDevice

func (m *Monitor) AddDevice(name string, device config.Device)

AddDevice adds all objects of the given device to the monitor. This must be called before starting the monitor.

func (*Monitor) AddDeviceObject

func (m *Monitor) AddDeviceObject(name string, device config.Device, obj config.Object)

AddDeviceObject adds the given object to the monitor. This must be called before starting the monitor.

func (*Monitor) AddObject

func (m *Monitor) AddObject(obj *Object)

AddObject adds the given object to the monitor. This must be called before starting the monitor.

func (*Monitor) Poll

func (m *Monitor) Poll(ctx context.Context) error

type Object

type Object struct {
	Name  string              `json:"name,omitempty"` // the name we associate problems with
	Test  string              `json:"test,omitempty"` // problem name suffix
	Level gen.StatusLog_Level `json:"level,omitempty"`

	// these help us to determine the health of the object
	EventState   *config.ValueSource `json:"eventState,omitempty"`
	Reliability  *config.ValueSource `json:"reliability,omitempty"`
	OutOfService *config.ValueSource `json:"outOfService,omitempty"`
	// these help with improving the quality of the status reporting for the above
	LowLimit  *config.ValueSource `json:"lowLimit,omitempty"`
	HighLimit *config.ValueSource `json:"highLimit,omitempty"`
	// These allow an object to explicitly represent a fault via its PresentValue.
	// If the value isn't equal to the nominalValue then we'll report a fault.
	Value        *config.ValueSource `json:"value,omitempty"`
	NominalValue any                 `json:"nominalValue,omitempty"`
}

Jump to

Keyboard shortcuts

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