From 500f932c0df5fa7fc14d7567dfb6869baf820804 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torma=20Krist=C3=B3f?= Date: Fri, 26 Apr 2019 15:16:40 +0200 Subject: [PATCH] Create report.lua --- benchmark/report.lua | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 benchmark/report.lua diff --git a/benchmark/report.lua b/benchmark/report.lua new file mode 100644 index 0000000..20dd9db --- /dev/null +++ b/benchmark/report.lua @@ -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