Documentation
¶
Overview ¶
Package metrics contains the code for receiving and reporting host metrics.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Add ¶
func Add(id MetricID, value MetricValue)
Add takes a single metric (id and value) from a metric provider. The function buffers the metric and returns immediately.
func AddSlice ¶
func AddSlice(newMetrics []Metric)
AddSlice takes a slice of metrics from a metric provider. The function buffers the metrics and returns immediately.
Here we collect all metrics until the timestamp changes. We then call report() to report all metrics from the previous timestamp.
|----------------- 1s period -------------| |--+--------------------------+-----------|--+--...... | | | report(),AddSlice(ID1) | | AddSlice(ID2) | | report(),AddSlice(ID1)
This ensures that the buffered metrics from the previous timestamp are sent with the correctly assigned TSMetric.Timestamp.
func SetReporter ¶
func SetReporter(r reporter.MetricsReporter)
SetReporter sets the reporter instance used to send out metrics.
Types ¶
type Metric ¶
type Metric struct { ID MetricID Value MetricValue }
Metric is the type for a metric id/value pair.
type Summary ¶
type Summary map[MetricID]MetricValue
Summary helps summarizing metrics of the same ID from different sources before processing it further.
Directories
¶
Path | Synopsis |
---|---|
Package agentmetrics implements the fetching and reporting of agent specific metrics.
|
Package agentmetrics implements the fetching and reporting of agent specific metrics. |
Package reportermetrics implements the fetching and reporting of agent specific metrics.
|
Package reportermetrics implements the fetching and reporting of agent specific metrics. |