status

package
v0.0.0-...-89602ce Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2020 License: BSD-3-Clause Imports: 15 Imported by: 0

Documentation

Overview

package status implements magmad status amd metrics collectors & reporters

package status implements magmad status amd metrics collectors & reporters

package status implements magmad status collector & reporter

package status implements magmad status amd metrics collectors & reporters

Index

Constants

View Source
const (
	MinCheckinIntervalSeconds     = 30
	DefaultCheckinIntervalSeconds = MinCheckinIntervalSeconds * 2
)

Variables

This section is empty.

Functions

func StartReporter

func StartReporter()

StartReporter starts state collection & reporting loop StartReporter also initiates periodic services metrics collection. Since status & metrics collections are done using the same GRPC clients and goroutines, status collection timer is the main driver of collections intervals, status collection and reporting will be done according to magmad's config checkin interval settings. Metrics collection & reporting is also done during status collection/reporting window, but an additiona condition of time elapsed from last metrics collection/reporting is equal or longer then Metricsd.CollectInterval, Metricsd.SyncInterval respectively must be also satisfied. It's therefore preferable to set Metricsd.CollectInterval, Metricsd.SyncInterval to be multiples of mconf.CheckinInterval StartReporter never returns, it'll log errors if any and continue

Types

type MetricsQueue

type MetricsQueue struct {
	sync.Mutex
	// contains filtered or unexported fields
}

MetricsQueue - definition of metrics queue "object" MetricsQueue is not a traditional queue, it only implements:

append, collect/reset & prepend with a limit functionality

func (*MetricsQueue) Append

func (q *MetricsQueue) Append(elems ...*prometheus.MetricFamily) (qlen int)

Append adds elements to the end of the queue

func (*MetricsQueue) Collect

func (q *MetricsQueue) Collect() []*prometheus.MetricFamily

Collect returns the que items and empties the queue

func (*MetricsQueue) Prepend

func (q *MetricsQueue) Prepend(elems []*prometheus.MetricFamily, maxQueueLen int) int

Prepend inserts up to len(elems) elements at the start of the queue while maintaining given max len of the queue it returns the actual number of elements inserted Note: if len(elems) > # elements inserted, inserted elements are taken from the end elems slice

func (*MetricsQueue) Reset

func (q *MetricsQueue) Reset()

Reset clears the queue

Jump to

Keyboard shortcuts

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