monitors

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2023 License: GPL-3.0 Imports: 10 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Counter

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

func NewCounter

func NewCounter(
	name string,
	cumalative, ignoreZeroSnapshots bool,
) *Counter

Returns a counter. If 'cumalative=true' then setting the counter value is assumed to be a cumalative value and will be determined using the last accumlated value.

func NewCounterWithAttribs

func NewCounterWithAttribs(
	name string,
	cumalative, ignoreZeroSnapshots bool,
	attribs map[string]string,
) *Counter

func (*Counter) Add

func (c *Counter) Add(value int64)

func (*Counter) AddAttribute

func (c *Counter) AddAttribute(name, value string)

func (*Counter) Get

func (c *Counter) Get() int64

func (*Counter) Inc

func (c *Counter) Inc()

func (*Counter) Name

func (c *Counter) Name() string

func (*Counter) Set

func (c *Counter) Set(value int64)

func (*Counter) SetInc

func (c *Counter) SetInc(incValue int64)

type Monitor

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

func (*Monitor) AddCounter

func (m *Monitor) AddCounter(counter *Counter)

func (*Monitor) DeleteCounter

func (m *Monitor) DeleteCounter(counter *Counter)

type MonitorService

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

func NewMonitorService

func NewMonitorService(sender Sender, collectCount, collectInterval int) *MonitorService

Creates a new monitor services with a 'sender' that will post monitor events to an upstream service. The monitor collects metrics from all counters every 'collectInterval' milliseconds and publishes these metrics after 'collectCount' collections.

func (*MonitorService) NewMonitor

func (ms *MonitorService) NewMonitor(name string) *Monitor

func (*MonitorService) Start

func (ms *MonitorService) Start() error

func (*MonitorService) Stop

func (ms *MonitorService) Stop()

type Sender

type Sender interface {
	PostMeasurementEvents(events []*cloudevents.Event) ([]events.CloudEventError, error)
}

Jump to

Keyboard shortcuts

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