/
request.go
30 lines (26 loc) · 861 Bytes
/
request.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
package model
// Request is the container that holds a JSON request
type Request struct {
Agent Agent `json:"agent"`
Plugins []PluginSnapshot `json:"components"`
}
// Agent encapsulates the agent info
type Agent struct {
Host string `json:"host"`
Version string `json:"version"`
PID int `json:"pid"`
}
// PluginSnapshot encapsulates the current, unset state of a component
type PluginSnapshot struct {
Name string `json:"name"`
GUID string `json:"guid"`
DurationSec int `json:"duration"`
Metrics map[string]interface{} `json:"metrics"`
}
type MetricValue struct {
Min float64 `json:"min"`
Max float64 `json:"max"`
Total float64 `json:"total"`
Count int `json:"count"`
SumOfSquares float64 `json:"sum_of_squares"`
}