|
|
@ -99,10 +99,37 @@ type AgentToken struct { |
|
|
|
// Metrics info is used to store different types of metric values from the agent.
|
|
|
|
// Metrics info is used to store different types of metric values from the agent.
|
|
|
|
type MetricsInfo struct { |
|
|
|
type MetricsInfo struct { |
|
|
|
Timestamp string |
|
|
|
Timestamp string |
|
|
|
Gauges []map[string]interface{} |
|
|
|
Gauges []GaugeValue |
|
|
|
Points []map[string]interface{} |
|
|
|
Points []PointValue |
|
|
|
Counters []map[string]interface{} |
|
|
|
Counters []SampledValue |
|
|
|
Samples []map[string]interface{} |
|
|
|
Samples []SampledValue |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// GaugeValue stores one value that is updated as time goes on, such as
|
|
|
|
|
|
|
|
// the amount of memory allocated.
|
|
|
|
|
|
|
|
type GaugeValue struct { |
|
|
|
|
|
|
|
Name string |
|
|
|
|
|
|
|
Value float32 |
|
|
|
|
|
|
|
Labels map[string]string |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// PointValue holds a series of points for a metric.
|
|
|
|
|
|
|
|
type PointValue struct { |
|
|
|
|
|
|
|
Name string |
|
|
|
|
|
|
|
Points []float32 |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// SampledValue stores info about a metric that is incremented over time,
|
|
|
|
|
|
|
|
// such as the number of requests to an HTTP endpoint.
|
|
|
|
|
|
|
|
type SampledValue struct { |
|
|
|
|
|
|
|
Name string |
|
|
|
|
|
|
|
Count int |
|
|
|
|
|
|
|
Sum float64 |
|
|
|
|
|
|
|
Min float64 |
|
|
|
|
|
|
|
Max float64 |
|
|
|
|
|
|
|
Mean float64 |
|
|
|
|
|
|
|
Stddev float64 |
|
|
|
|
|
|
|
Labels map[string]string |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Agent can be used to query the Agent endpoints
|
|
|
|
// Agent can be used to query the Agent endpoints
|
|
|
|