monitoring_service

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2021 License: MIT Imports: 4 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

Types

type IntegralMetric

type IntegralMetric struct {
	MetricInterface
	// contains filtered or unexported fields
}

func (*IntegralMetric) Get

func (m *IntegralMetric) Get() int64

func (*IntegralMetric) Set

func (m *IntegralMetric) Set(newValue int64)

type MetricInterface

type MetricInterface interface {
	Set(measure int64)
	Get() int64
}

type Monitoring

type Monitoring struct {
	EventCap int
	// contains filtered or unexported fields
}

func (*Monitoring) Init

func (m *Monitoring) Init(topic contracts.Topic, calcType contracts.MetricType) error

func (*Monitoring) Listen

func (m *Monitoring) Listen(topic contracts.Topic, callback func() int64) error

func (*Monitoring) Publish

func (m *Monitoring) Publish(topic contracts.Topic, measurement int64) error

func (*Monitoring) Run

func (m *Monitoring) Run()

type MonitoringMock

type MonitoringMock struct {
	contracts.MonitoringInterface

	/*
		You need to substitute *Mock methods to do substitute original functions
	*/
	InitMock    func(topic contracts.Topic, metricType contracts.MetricType) error
	PublishMock func(topic contracts.Topic, measurement int64) error
	ListenMock  func(topic contracts.Topic, callback func() int64) error
	RunMock     func()
}

func (*MonitoringMock) Init

func (m *MonitoringMock) Init(topic contracts.Topic, metricType contracts.MetricType) error

func (*MonitoringMock) Listen

func (m *MonitoringMock) Listen(topic contracts.Topic, callback func() int64) error

func (*MonitoringMock) Publish

func (m *MonitoringMock) Publish(topic contracts.Topic, measurement int64) error

func (*MonitoringMock) Run

func (m *MonitoringMock) Run()

type Options

type Options struct {
	PeriodMeasure time.Duration
	EventCap      int

	/*
		Subscribing to measurement events
	*/
	Subscriptions map[contracts.Topic]func(event contracts.MeasurementEvent)
}

type ValueMetric

type ValueMetric struct {
	MetricInterface
	// contains filtered or unexported fields
}

func (*ValueMetric) Get

func (m *ValueMetric) Get() int64

func (*ValueMetric) Set

func (m *ValueMetric) Set(newValue int64)

type VelocityMetric

type VelocityMetric struct {
	MetricInterface
	// contains filtered or unexported fields
}

func (*VelocityMetric) Get

func (m *VelocityMetric) Get() int64

func (*VelocityMetric) Set

func (m *VelocityMetric) Set(countItems int64)

Jump to

Keyboard shortcuts

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