From 335d3952739e5fe3ccf010a2426b66de552a2919 Mon Sep 17 00:00:00 2001 From: Mario Bielert Date: Fri, 24 Feb 2023 22:35:21 +0100 Subject: [PATCH] history: fix empty and error in timeline requests --- packages/history/metricq-history.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/history/metricq-history.js b/packages/history/metricq-history.js index 552b31d..b8479ea 100644 --- a/packages/history/metricq-history.js +++ b/packages/history/metricq-history.js @@ -124,9 +124,10 @@ class Timeline { return this; } - _parse_result(result) { - let data = result["data"]; + _parse_result({ data }) { for (const metric_data of Object.values(data)) { + if (metric_data.mode === "empty" || metric_data.error !== undefined) + continue; for (const value of metric_data[metric_data.mode]) { value.timestamp = moment(value.timestamp / 1e6); }