-
Notifications
You must be signed in to change notification settings - Fork 19
/
sync_report.go
63 lines (54 loc) · 2.54 KB
/
sync_report.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
59
60
61
62
63
package v1
import "time"
type Status string
const (
Pending Status = "Pending"
Failed Status = "Failed"
Running Status = "Running"
Unknown Status = "Unknown"
)
// NodeInfo node info
type NodeInfo struct {
Hostname string `yaml:"hostname,omitempty" json:"hostname,omitempty"`
Address string `yaml:"address,omitempty" json:"address,omitempty"`
Arch string `yaml:"arch,omitempty" json:"arch,omitempty"`
KernelVersion string `yaml:"kernelVer,omitempty" json:"kernelVer,omitempty"`
OS string `yaml:"os,omitempty" json:"os,omitempty"`
ContainerRuntime string `yaml:"containerRuntime,omitempty" json:"containerRuntime"`
MachineID string `yaml:"machineID,omitempty" json:"machineID"`
BootID string `yaml:"bootID,omitempty" json:"bootID"`
SystemUUID string `yaml:"systemUUID,omitempty" json:"systemUUID"`
OSImage string `yaml:"osImage,omitempty" json:"osImage"`
}
// NodeStats node statistics
type NodeStats struct {
Usage map[string]string `yaml:"usage,omitempty" json:"usage,omitempty"`
Capacity map[string]string `yaml:"capacity,omitempty" json:"capacity,omitempty"`
Percent map[string]string `yaml:"percent,omitempty" json:"percent,omitempty"`
}
// AppInfo app info
type AppInfo struct {
Name string `yaml:"name,omitempty" json:"name,omitempty"`
Version string `yaml:"version,omitempty" json:"version,omitempty"`
}
// AppStats app statistics
type AppStats struct {
AppInfo `yaml:",inline" json:",inline"`
Status Status `yaml:"status,omitempty" json:"status,omitempty"`
Cause string `yaml:"cause,omitempty" json:"cause,omitempty"`
InstanceStats map[string]InstanceStats `yaml:"instances,omitempty" json:"instances,omitempty"`
}
type CoreInfo struct {
GoVersion string `yaml:"goVersion,omitempty" json:"goVersion,omitempty"`
BinVersion string `yaml:"binVersion,omitempty" json:"binVersion,omitempty"`
GitRevision string `yaml:"gitRevision,omitempty" json:"gitRevision,omitempty"`
}
// InstanceStats instance stats
type InstanceStats struct {
Name string `yaml:"name,omitempty" json:"name,omitempty"`
ServiceName string `yaml:"serviceName,omitempty" json:"serviceName"`
Usage map[string]string `yaml:"usage,omitempty" json:"usage,omitempty"`
Status Status `yaml:"status,omitempty" json:"status,omitempty"`
Cause string `yaml:"cause,omitempty" json:"cause,omitempty"`
CreateTime time.Time `yaml:"createTime,omitempty" json:"createTime,omitempty"`
}