[agent-go] [status] - start to unit
This commit is contained in:
@@ -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))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user