From 4af3c5efebd51f6cba1bfa71f051758c5d667388 Mon Sep 17 00:00:00 2001 From: Kensei Nakada Date: Thu, 5 May 2022 16:11:22 +0000 Subject: [PATCH] Skip adding data to avoid "json: unsupported value: NaN" panic when data is NaN --- test/integration/scheduler_perf/util.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/test/integration/scheduler_perf/util.go b/test/integration/scheduler_perf/util.go index 6e84213788f..114c119a660 100644 --- a/test/integration/scheduler_perf/util.go +++ b/test/integration/scheduler_perf/util.go @@ -243,7 +243,12 @@ func collectHistogramVec(metric string, labels map[string]string, lvMap map[stri } if err := vec.Validate(); err != nil { - klog.Error(err) + klog.ErrorS(err, "the validation for HistogramVec is failed. The data for this metric won't be stored in a benchmark result file", "metric", metric, "labels", labels) + return nil + } + + if vec.GetAggregatedSampleCount() == 0 { + klog.InfoS("It is expected that this metric wasn't recorded. The data for this metric won't be stored in a benchmark result file", "metric", metric, "labels", labels) return nil }