-
Notifications
You must be signed in to change notification settings - Fork 0
/
models.go
58 lines (43 loc) · 1.21 KB
/
models.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
50
51
52
53
54
55
56
57
58
package monibot
// Watchdog holds data for a Watchdog.
type Watchdog struct {
Id string `json:"id"`
Name string `json:"name"`
IntervalMillis int64 `json:"intervalMillis"`
}
// Machine holds data for a Machine.
type Machine struct {
Id string `json:"id"`
Name string `json:"name"`
}
// A MachineSample holds data for a machine resource usage sample.
type MachineSample struct {
// Unix time millis since 1970-01-01T00:00:00Z, always UTC, never local time.
Tstamp int64
// Loadavg 1 minute.
Load1 float64
// Loadavg 5 minutes.
Load5 float64
// Loadavg 15 minutes.
Load15 float64
// CPU usage percent 0..100 since last sample.
CpuPercent int
// Memory usage percent 0..100.
MemPercent int
// Disk usage percent 0..100.
DiskPercent int
// Number of disk sectors read since last sample.
DiskReads int64
// Number of disk sectors written since last sample.
DiskWrites int64
// Number of network bytes received since last sample.
NetRecv int64
// Number of network bytes sent since last sample.
NetSend int64
}
// Metric holds data for a Metric.
type Metric struct {
Id string `json:"id"`
Name string `json:"name"`
Type int `json:"type"` // 0=Counter, 1=Gauge, 2=Histogram
}