aboutsummaryrefslogtreecommitdiff
path: root/contrib/benchmark/collect.awk
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/benchmark/collect.awk')
-rw-r--r--contrib/benchmark/collect.awk22
1 files changed, 13 insertions, 9 deletions
diff --git a/contrib/benchmark/collect.awk b/contrib/benchmark/collect.awk
index 3853936bd..12ece0ebf 100644
--- a/contrib/benchmark/collect.awk
+++ b/contrib/benchmark/collect.awk
@@ -27,21 +27,25 @@
27# url <url> status <status> count <count> time_us <time_us> 27# url <url> status <status> count <count> time_us <time_us>
28{ 28{
29 if ($1 == "op") { 29 if ($1 == "op") {
30 op[$2]["count"] += $4; 30 n = $4;
31 op[$2]["time_us"] += $6; 31 t = $6;
32 op[$2]["time_us_sq"] += $6 * $6; 32 op[$2]["count"] += n;
33 op[$2]["time_us"] += t;
34 op[$2]["time_us_sq"] += n * (t/n) * (t/n);
33 } else if ($1 == "url") { 35 } else if ($1 == "url") {
34 url[$2][$4]["count"] += $6; 36 n = $6;
35 url[$2][$4]["time_us"] += $8; 37 t = $8;
36 url[$2][$4]["time_us_sq"] += $8 * $8; 38 url[$2][$4]["count"] += n;
39 url[$2][$4]["time_us"] += t;
40 url[$2][$4]["time_us_sq"] += n * (t/n) * (t/n);
37 } 41 }
38} 42}
39 43
40function avg(s, c) { 44function avg(sum, n) {
41 if (c == 0) { 45 if (n == 0) {
42 return 0; 46 return 0;
43 } else { 47 } else {
44 return s / c; 48 return sum / n;
45 } 49 }
46} 50}
47 51