forked from the-benchmarker/web-frameworks
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pipeline.lua
50 lines (46 loc) · 1.1 KB
/
pipeline.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
-- duration in microseconds
-- total completed requests
-- total completed requests per seconds
-- total bytes received
-- total socket connection errors
-- total socket read errors
-- total socket write errors
-- total http errors (status > 399)
-- total request timeouts
-- minimum latency
-- maximum latency
-- average latency
-- standard deviation
-- percentile : 50
-- percentile : 75
-- percentile : 90
-- percentile : 99
-- percentile : 99.999
done = function(summary, latency, requests)
out = {
summary.duration,
summary.requests,
summary.requests/(summary.duration/1000000),
summary.bytes,
summary.errors.connect,
summary.errors.read,
summary.errors.write,
summary.errors.status,
summary.errors.timeout,
latency.min,
latency.max,
latency.mean,
latency.stdev,
latency:percentile(50),
latency:percentile(75),
latency:percentile(90),
latency:percentile(99),
latency:percentile(99.999)
}
for key, value in pairs(out) do
if key > 1 then
io.stderr:write(",")
end
io.stderr:write(string.format("%d", value))
end
end