Created
October 10, 2016 14:10
-
-
Save YutaroHayakawa/7f4a1447bc7d66bb42cd529dfe93a329 to your computer and use it in GitHub Desktop.
Lua script for formatting output of wrk to csv
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment