Skip to content

Instantly share code, notes, and snippets.

@hoang-tranviet
Created January 19, 2021 19:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hoang-tranviet/4c607e3eb0569af53afab0160ed01ab7 to your computer and use it in GitHub Desktop.
Save hoang-tranviet/4c607e3eb0569af53afab0160ed01ab7 to your computer and use it in GitHub Desktop.
lua script for wrk tool to get raw latency
-- done() function that prints latency percentiles as CSV
done = function(summary, latency, requests)
epoch = os.time()
f = io.open(epoch .. ".csv", "a+")
f.write("------------------------------\n")
f.write("epoch", os.time())
f.write("number_requests:", summary.requests)
-- for i, val in ipairs(latency) do
for i = 1, summary.requests do
val = latency(i)
f.write(string.format("%g\t %d \n", i, val))
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment