From 18db920cf142d9b6cbe9e3da24aeafb518a21549 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torma=20Krist=C3=B3f?= Date: Mon, 14 Oct 2019 20:47:38 +0200 Subject: [PATCH] classic benchmarer --- benchmark/{ => classic}/benchmark.sh | 0 benchmark/classic/hello.body | 1 + benchmark/classic/hello.wrk | 1 + benchmark/classic/isprime.body | 1 + benchmark/classic/isprime.wrk | 26 ++++++++++++++++++++++++++ benchmark/classic/report.lua | 24 ++++++++++++++++++++++++ 6 files changed, 53 insertions(+) rename benchmark/{ => classic}/benchmark.sh (100%) create mode 100644 benchmark/classic/hello.body create mode 100644 benchmark/classic/hello.wrk create mode 100644 benchmark/classic/isprime.body create mode 100644 benchmark/classic/isprime.wrk create mode 100644 benchmark/classic/report.lua diff --git a/benchmark/benchmark.sh b/benchmark/classic/benchmark.sh similarity index 100% rename from benchmark/benchmark.sh rename to benchmark/classic/benchmark.sh diff --git a/benchmark/classic/hello.body b/benchmark/classic/hello.body new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/benchmark/classic/hello.body @@ -0,0 +1 @@ + diff --git a/benchmark/classic/hello.wrk b/benchmark/classic/hello.wrk new file mode 100644 index 0000000..ecfad3a --- /dev/null +++ b/benchmark/classic/hello.wrk @@ -0,0 +1 @@ +wrk.method = "GET" diff --git a/benchmark/classic/isprime.body b/benchmark/classic/isprime.body new file mode 100644 index 0000000..1f048b6 --- /dev/null +++ b/benchmark/classic/isprime.body @@ -0,0 +1 @@ +107107 diff --git a/benchmark/classic/isprime.wrk b/benchmark/classic/isprime.wrk new file mode 100644 index 0000000..fdb0082 --- /dev/null +++ b/benchmark/classic/isprime.wrk @@ -0,0 +1,26 @@ +wrk.method = "POST" +wrk.body = "107107" +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 diff --git a/benchmark/classic/report.lua b/benchmark/classic/report.lua new file mode 100644 index 0000000..20dd9db --- /dev/null +++ b/benchmark/classic/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