-
Notifications
You must be signed in to change notification settings - Fork 2
/
dataObject.go
43 lines (37 loc) · 964 Bytes
/
dataObject.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
package main
//DataObject holds data
type DataObject struct {
Timestamp int64 `json:"timestamp"`
CPU CPUStats `json:"cpu"`
RAM RAMStats `json:"ram"`
Partitions []PartitionStats `json:"partitions"`
System SystemStats `json:"system"`
Network NetStats `json:"network"`
}
//RAMStats x
type RAMStats struct {
Total uint64 `json:"total"`
Free uint64 `json:"free"`
Used uint64 `json:"used"`
}
//CPUStats x
type CPUStats struct {
Utilization float64 `json:"utilization"`
}
//PartitionStats holds data about partition stats
type PartitionStats struct {
Name string `json:"name"`
Total uint64 `json:"total"`
Free uint64 `json:"free"`
Used uint64 `json:"used"`
}
//SystemStats x
type SystemStats struct {
Uptime uint64 `json:"uptime"`
Processes uint64 `json:"processes"`
}
//NetStats x
type NetStats struct {
BytesSent uint64 `json:"sent"`
BytesReceived uint64 `json:"recv"`
}