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 ¶
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 ¶
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