Configurable metrics max batch size

This commit is contained in:
Bo0km4n 2020-06-20 15:58:14 +09:00
parent 84e5896299
commit 53a6b0fd3b
7 changed files with 28 additions and 2 deletions

View file

@ -30,6 +30,18 @@ describe("Monitor", function()
package.loaded["monitor"] = nil
end)
it("extended batch size", function()
local monitor = require("monitor")
mock_ngx({ var = {} })
monitor.set_metrics_max_batch_size(20000)
for i = 1,20000,1 do
monitor.call()
end
assert.equal(20000, #monitor.get_metrics_batch())
end)
it("batches metrics", function()
local monitor = require("monitor")
mock_ngx({ var = {} })