diff options
-rw-r--r-- | contrib/benchmark/collect.awk | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/contrib/benchmark/collect.awk b/contrib/benchmark/collect.awk index b91a978b6..159e4897a 100644 --- a/contrib/benchmark/collect.awk +++ b/contrib/benchmark/collect.awk | |||
@@ -25,6 +25,12 @@ | |||
25 | # records are of the following forms: | 25 | # records are of the following forms: |
26 | # op <op> count <count> time_us <time_us> | 26 | # op <op> count <count> time_us <time_us> |
27 | # url <url> status <status> count <count> time_us <time_us> | 27 | # url <url> status <status> count <count> time_us <time_us> |
28 | |||
29 | |||
30 | function abs(v) { | ||
31 | return v < 0 ? -v : v | ||
32 | } | ||
33 | |||
28 | { | 34 | { |
29 | if ($1 == "op") { | 35 | if ($1 == "op") { |
30 | n = $4; | 36 | n = $4; |
@@ -57,7 +63,7 @@ function stdev(sum, sum_sq, n) { | |||
57 | if (n == 0) { | 63 | if (n == 0) { |
58 | return 0; | 64 | return 0; |
59 | } else { | 65 | } else { |
60 | return sqrt( (sum_sq / n) - ( (sum / n) * (sum / n) ) ); | 66 | return sqrt(abs((sum_sq / n) - ((sum / n) * (sum / n)))); |
61 | } | 67 | } |
62 | } | 68 | } |
63 | 69 | ||