mirror of
https://github.com/TeaOSLab/EdgeNode.git
synced 2025-11-05 09:30:26 +08:00
edge-node gc命令中的pause时间改为最近一次回收的pause时间
This commit is contained in:
@@ -784,9 +784,13 @@ func (this *Node) listenSock() error {
|
|||||||
var costSeconds = time.Since(before).Seconds()
|
var costSeconds = time.Since(before).Seconds()
|
||||||
var gcStats = &debug.GCStats{}
|
var gcStats = &debug.GCStats{}
|
||||||
debug.ReadGCStats(gcStats)
|
debug.ReadGCStats(gcStats)
|
||||||
|
var pauseMS float64
|
||||||
|
if len(gcStats.Pause) > 0 {
|
||||||
|
pauseMS = gcStats.Pause[0].Seconds() * 1000
|
||||||
|
}
|
||||||
_ = cmd.Reply(&gosock.Command{
|
_ = cmd.Reply(&gosock.Command{
|
||||||
Params: map[string]any{
|
Params: map[string]any{
|
||||||
"pauseMS": gcStats.PauseTotal.Seconds() * 1000,
|
"pauseMS": pauseMS,
|
||||||
"costMS": costSeconds * 1000,
|
"costMS": costSeconds * 1000,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user