[ Cmii ] [ Octopus ] - reformat agent-go - 1
This commit is contained in:
36
agent-go/a_status/CPU_test.go
Normal file
36
agent-go/a_status/CPU_test.go
Normal file
@@ -0,0 +1,36 @@
|
||||
package a_status
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestGetCPUStatus(t *testing.T) {
|
||||
cpuStatus, err := GetCPUMetric()
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
marshalIndent, err := json.MarshalIndent(cpuStatus, "", " ")
|
||||
if err != nil {
|
||||
fmt.Printf("error")
|
||||
}
|
||||
|
||||
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))
|
||||
}
|
||||
Reference in New Issue
Block a user