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