From 7793b5c4479dca1396acfa2e568ea32ecede6125 Mon Sep 17 00:00:00 2001 From: roggervalf Date: Wed, 4 Sep 2024 21:13:29 -0500 Subject: [PATCH] perf(metrics): save zeros as much as max data points --- src/commands/includes/collectMetrics.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/commands/includes/collectMetrics.lua b/src/commands/includes/collectMetrics.lua index c88f257bc4..8cfd25a4fe 100644 --- a/src/commands/includes/collectMetrics.lua +++ b/src/commands/includes/collectMetrics.lua @@ -17,7 +17,7 @@ local function collectMetrics(metaKey, dataPointsList, maxDataPoints, return end - local N = math.floor((timestamp - prevTS) / 60000) + local N = math.min(math.floor((timestamp - prevTS) / 60000), tonumber(maxDataPoints)) if N > 0 then local delta = count - rcall("HGET", metaKey, "prevCount")