From 347305451a9f5d7f2c16733eb139b5de96ea4b9c Mon Sep 17 00:00:00 2001 From: Rogger Valverde Date: Wed, 4 Sep 2024 21:22:29 -0600 Subject: [PATCH] perf(metrics): save zeros as much as max data points (#2758) --- 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")