[Agent] [Status] agent metric accomplish

This commit is contained in:
zeaslity
2023-12-21 11:39:19 +08:00
parent 8becc27472
commit 53f4f526cf
9 changed files with 246 additions and 49 deletions

View File

@@ -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)
}