[Agent] [Status] agent metric accomplish
This commit is contained in:
@@ -1,9 +1,10 @@
|
||||
package status
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"agent-go/utils"
|
||||
"fmt"
|
||||
"testing"
|
||||
"time"
|
||||
)
|
||||
|
||||
func TestConvertToFormat(t *testing.T) {
|
||||
@@ -15,12 +16,12 @@ func TestConvertToFormat(t *testing.T) {
|
||||
|
||||
func TestReportAppStatus(t *testing.T) {
|
||||
|
||||
agentStatus := ReportAppStatus()
|
||||
startTime := time.Now()
|
||||
agentStatus := ReportAgentMetric()
|
||||
|
||||
marshal, err := json.Marshal(agentStatus)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
endTime := time.Now()
|
||||
elapsedTime := endTime.Sub(startTime)
|
||||
fmt.Println("函数执行时间:", elapsedTime)
|
||||
|
||||
fmt.Printf(string(marshal))
|
||||
utils.BeautifulPrint(agentStatus)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user