Created
January 23, 2026 17:27
-
-
Save maurorappa/dad88ca86dffba806b580d790bf90947 to your computer and use it in GitHub Desktop.
wrk(http benchmark took) lua report script
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) | |
| local bucket_size = 1000 | |
| local star_value = 100 | |
| io.write("\n--------------------- percentiles ----------------\n") | |
| for _, p in pairs({ 50, 75, 90, 99, 99.999 }) do | |
| n = latency:percentile(p) | |
| io.write(string.format("%gp, %d\n", p, n)) | |
| end | |
| io.write("------------ bucket distribution ------------------\n") | |
| local counts = {} | |
| for i=1, #latency do | |
| local group = math.floor(latency(i) / bucket_size) * bucket_size | |
| counts[group] = (counts[group] or 0) + 1 | |
| end | |
| local groups = {} | |
| for g in pairs(counts) do | |
| table.insert(groups, g) | |
| end | |
| table.sort(groups) | |
| for _, g in ipairs(groups) do | |
| tot = math.floor(counts[g]/star_value) | |
| if tot > 0 then | |
| io.write(string.format("%2dus: %s\n", g, string.rep("*", tot))) | |
| end | |
| end | |
| io.write("------------ 1 * = "..star_value.." measurements ----------------\n\n") | |
| end |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
better reporting for wrk (https://github.com/wg/wrk)
It provides percentiles and bucket distribution to quickly evaluate test results