in scripts/runner.lua [44:69]
done = function(summary, latency, requests)
f = io.open("test-result.csv", "a+")
local fSize = fsize(f)
if fSize == 0 then
f:write("Percentile,Value (ms),Requests Per Second\n")
end
local duration_in_sec = (summary["duration"] / 1000000)
local rps = (summary["requests"] / duration_in_sec)
local _rps = string.format("%.2f RPS", rps)
for _, p in pairs({ 0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 95, 99, 99.9, 99.999, 100 }) do
f:write(string.format("%f,%f,%s\n",
p,
(latency:percentile(p) / 1000),
_rps
)
)
end
f:close()
end