[agent-go] [executor] real time executor
This commit is contained in:
@@ -2,6 +2,8 @@ package status
|
||||
|
||||
import (
|
||||
logger2 "agent-go/logger"
|
||||
"fmt"
|
||||
"time"
|
||||
)
|
||||
|
||||
var log = logger2.Log
|
||||
@@ -13,6 +15,18 @@ type AgentStatus struct {
|
||||
DiskStatus *DiskStatus
|
||||
}
|
||||
|
||||
func ConvertToFormat(eventData float64) string {
|
||||
duration := time.Duration(eventData) * time.Second
|
||||
|
||||
fmt.Println(duration)
|
||||
|
||||
hours := int(duration.Hours())
|
||||
minutes := int(duration.Minutes()) % 60
|
||||
seconds := int(duration.Seconds()) % 60
|
||||
milliseconds := duration.Milliseconds() % 1000
|
||||
return fmt.Sprintf("%02d:%02d:%02d,%03d", hours, minutes, seconds, milliseconds)
|
||||
}
|
||||
|
||||
func Ping() string {
|
||||
return "PONG"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user