aboutsummaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2018-09-24 19:33:43 +0200
committerFlorian Dold <florian.dold@gmail.com>2018-09-24 19:33:43 +0200
commitafbafd99c2b66bd3e35df763623883192cdad67d (patch)
treefadd038fbfba3e038cfbb4f848342106559a34ac /contrib
parent11abc0ca801911ab584798d95f7c955933050226 (diff)
downloadgnunet-afbafd99c2b66bd3e35df763623883192cdad67d.tar.gz
gnunet-afbafd99c2b66bd3e35df763623883192cdad67d.zip
benchmark: throw in abs
Diffstat (limited to 'contrib')
-rw-r--r--contrib/benchmark/collect.awk8
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
30function 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