projects
/
oweals
/
gnunet.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
11abc0c
)
benchmark: throw in abs
author
Florian Dold
<florian.dold@gmail.com>
Mon, 24 Sep 2018 17:33:43 +0000
(19:33 +0200)
committer
Florian Dold
<florian.dold@gmail.com>
Mon, 24 Sep 2018 17:33:43 +0000
(19:33 +0200)
contrib/benchmark/collect.awk
patch
|
blob
|
history
diff --git
a/contrib/benchmark/collect.awk
b/contrib/benchmark/collect.awk
index b91a978b6521f8e1359b9072bb26eab01eb097a9..159e4897af10720ab2c7a3f1d1be17a393ddb097 100644
(file)
--- a/
contrib/benchmark/collect.awk
+++ b/
contrib/benchmark/collect.awk
@@
-25,6
+25,12
@@
# records are of the following forms:
# op <op> count <count> time_us <time_us>
# url <url> status <status> count <count> time_us <time_us>
+
+
+function abs(v) {
+ return v < 0 ? -v : v
+}
+
{
if ($1 == "op") {
n = $4;
@@
-57,7
+63,7
@@
function stdev(sum, sum_sq, n) {
if (n == 0) {
return 0;
} else {
- return sqrt(
(sum_sq / n) - ( (sum / n) * (sum / n) )
);
+ return sqrt(
abs((sum_sq / n) - ((sum / n) * (sum / n)))
);
}
}