[agent-go] [status] - start to unit

This commit is contained in:
zeaslity
2023-04-23 14:15:12 +08:00
parent 6b9487b9b2
commit c5143d2d59
8 changed files with 139 additions and 3 deletions

View File

@@ -1,6 +1,7 @@
package status
import (
"encoding/json"
"fmt"
"testing"
)
@@ -17,4 +18,11 @@ func TestGetMemoryStatus(t *testing.T) {
fmt.Printf("Available Memory: %s\n", FormatMemorySize(memoryStatus.AvailableMemory))
fmt.Printf("Total Virtual Memory: %s\n", FormatMemorySize(memoryStatus.TotalVirtualMemory))
fmt.Printf("Used Virtual Memory: %s\n", FormatMemorySize(memoryStatus.UsedVirtualMemory))
marshalIndent, err := json.MarshalIndent(memoryStatus, "", " ")
if err != nil {
fmt.Printf("error")
}
fmt.Println(string(marshalIndent))
}