From 72b99327fcd6abf073f17e2581ad3cf8af501cde Mon Sep 17 00:00:00 2001 From: Thang Do Date: Mon, 21 Oct 2024 09:41:47 +1030 Subject: [PATCH] bug: ignore metric points with NaN ActivePct value --- remote/internal/prettify.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/remote/internal/prettify.go b/remote/internal/prettify.go index 8c76eaf..7b16ecf 100644 --- a/remote/internal/prettify.go +++ b/remote/internal/prettify.go @@ -2,6 +2,7 @@ package internal import ( "fmt" + "math" "sort" "golang.org/x/text/cases" @@ -70,6 +71,10 @@ func prettifyMetric(metric PendulumMetric, n int) string { name := cases.Title(language.English, cases.Compact).String(metric.Name) out := fmt.Sprintf("# Top %d %s:\n", n, prettifyMetricName(name)) for i := 0; i < n; i++ { + if math.IsNaN(float64(metric.Value[keys[i]].ActivePct)) { + continue + } + out = fmt.Sprintln(out, prettifyEntry(metric.Value[keys[i]], i, l, n)) }