Create report.lua

This commit is contained in:
Torma Kristóf 2019-04-26 15:16:40 +02:00 committed by GitHub
parent 34bcfe6f6b
commit 500f932c0d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 24 additions and 0 deletions

24
benchmark/report.lua Normal file
View File

@ -0,0 +1,24 @@
done = function(summary, latency, requests)
-- open output file
f = io.open("result.csv", "a+")
-- write below results to file
-- minimum latency
-- max latency
-- mean of latency
-- standard deviation of latency
-- 50percentile latency
-- 90percentile latency
-- 99percentile latency
-- 99.999percentile latency
-- duration of the benchmark
-- total requests during the benchmark
-- total received bytes during the benchmark
f:write(string.format("%f,%f,%f,%f,%f,%f,%f,%f,%d,%d,%d\n",
latency.min, latency.max, latency.mean, latency.stdev, latency:percentile(50),
latency:percentile(90), latency:percentile(99), latency:percentile(99.999),
summary["duration"], summary["requests"], summary["bytes"]))
f:close()
end