[ Agent ] [ Status ] - refresh status part

This commit is contained in:
zeaslity
2023-12-20 15:50:08 +08:00
parent 3312052645
commit 4d56083b5a
15 changed files with 423 additions and 68 deletions

View File

@@ -7,7 +7,7 @@ import (
)
func TestGetCPUStatus(t *testing.T) {
cpuStatus, err := GetCPUStatus()
cpuStatus, err := GetCPUMetric()
if err != nil {
return
}
@@ -20,3 +20,17 @@ func TestGetCPUStatus(t *testing.T) {
fmt.Println(string(marshalIndent))
}
func TestGetCPUInfo(t *testing.T) {
cpuInfo, err := GetCPUInfo()
if err != nil {
return
}
marshalIndent, err := json.MarshalIndent(cpuInfo, "", " ")
if err != nil {
fmt.Printf("error")
}
fmt.Println(string(marshalIndent))
}