Skip to content

Commit

Permalink
perf(metrics): save zeros as much as max data points (#2758)
Browse files Browse the repository at this point in the history
  • Loading branch information
roggervalf authored Sep 5, 2024
1 parent 69c1296 commit 3473054
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/commands/includes/collectMetrics.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit 3473054

Please sign in to comment.