gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] [gnunet] branch master updated: benchmark: throw in abs


From: gnunet
Subject: [GNUnet-SVN] [gnunet] branch master updated: benchmark: throw in abs
Date: Mon, 24 Sep 2018 19:35:16 +0200

This is an automated email from the git hooks/post-receive script.

dold pushed a commit to branch master
in repository gnunet.

The following commit(s) were added to refs/heads/master by this push:
     new afbafd99c benchmark: throw in abs
afbafd99c is described below

commit afbafd99c2b66bd3e35df763623883192cdad67d
Author: Florian Dold <address@hidden>
AuthorDate: Mon Sep 24 19:33:43 2018 +0200

    benchmark: throw in abs
---
 contrib/benchmark/collect.awk | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

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 @@
 # 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))));
   }
 }
 

-- 
To stop receiving notification emails like this one, please contact
address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]