-
Notifications
You must be signed in to change notification settings - Fork 54
/
metric.go
49 lines (38 loc) · 1 KB
/
metric.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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
package structs
import "time"
type Metric struct {
Name string `json:"name"`
Values MetricValues `json:"values"`
}
type Metrics []Metric
type MetricValue struct {
Average float64 `json:"avg"`
Count float64 `json:"count"`
Maximum float64 `json:"max"`
Minimum float64 `json:"min"`
Sum float64 `json:"sum"`
Time time.Time `json:"time"`
}
type MetricValues []MetricValue
type MetricsOptions struct {
End *time.Time `query:"end"`
Metrics []string `query:"metrics"`
Start *time.Time `query:"start"`
Period *int64 `query:"period"`
}
type ScraperMetricType string
const (
ScraperMetricTypeCpu ScraperMetricType = "cpu"
ScraperMetricTypeMem ScraperMetricType = "mem"
)
type MetricPoint struct {
Timestamp time.Time `json:"timestamp"`
Value uint64 `json:"value"`
}
type ScraperMetricList struct {
Items []ScraperMetric `json:"items"`
}
type ScraperMetric struct {
MetricPoints []MetricPoint `json:"metricPoints"`
MetricName string `json:"metricName"`
}