From f10ce36feb8b6b5402858af9fdc9bbe38d4d0d8c Mon Sep 17 00:00:00 2001 From: GoEdgeLab Date: Mon, 25 Dec 2023 12:43:13 +0800 Subject: [PATCH] =?UTF-8?q?edge-node=20gc=E5=91=BD=E4=BB=A4=E4=B8=AD?= =?UTF-8?q?=E7=9A=84pause=E6=97=B6=E9=97=B4=E6=94=B9=E4=B8=BA=E6=9C=80?= =?UTF-8?q?=E8=BF=91=E4=B8=80=E6=AC=A1=E5=9B=9E=E6=94=B6=E7=9A=84pause?= =?UTF-8?q?=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/nodes/node.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/internal/nodes/node.go b/internal/nodes/node.go index 734c200..8111eb2 100644 --- a/internal/nodes/node.go +++ b/internal/nodes/node.go @@ -784,9 +784,13 @@ func (this *Node) listenSock() error { var costSeconds = time.Since(before).Seconds() var gcStats = &debug.GCStats{} debug.ReadGCStats(gcStats) + var pauseMS float64 + if len(gcStats.Pause) > 0 { + pauseMS = gcStats.Pause[0].Seconds() * 1000 + } _ = cmd.Reply(&gosock.Command{ Params: map[string]any{ - "pauseMS": gcStats.PauseTotal.Seconds() * 1000, + "pauseMS": pauseMS, "costMS": costSeconds * 1000, }, })