giltene / wrk2

A constant throughput, correct latency recording variant of wrk
Apache License 2.0
4.28k stars 395 forks source link

I want to get u_latency from lua script file. #88

Open spareribs opened 4 years ago

spareribs commented 4 years ago

local counter = 0 local inspect = require 'inspect'

request = function() wrk.headers["x-auth-token"] = counter counter = counter + 1 return wrk.format(nil, path) end

function done(summary, latency, requests) print("======start of summary=============") print(inspect(summary)) -- QPS print("QPS", summary.requests / summary.duration 1000 1000) print("mean",latency.mean) print("percentile(50)",latency:percentile(50)) print("percentile(75)",latency:percentile(75)) print("percentile(90)",latency:percentile(90)) print("percentile(99)",latency:percentile(99)) print("percentile(99.9)",latency:percentile(99.9)) print("percentile(99.99)",latency:percentile(99.99)) print("percentile(99.999)",latency:percentile(99.999)) print("percentile(100.000)",latency:percentile(100.000)) print("======end of summary=============") end