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: collect standard


From: gnunet
Subject: [GNUnet-SVN] [gnunet] branch master updated: benchmark: collect standard deviation
Date: Mon, 24 Sep 2018 17:05:40 +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 fefd8e8b0 benchmark: collect standard deviation
fefd8e8b0 is described below

commit fefd8e8b0bf9ec3da99ee98a90e66632ee88eb10
Author: Florian Dold <address@hidden>
AuthorDate: Mon Sep 24 17:04:08 2018 +0200

    benchmark: collect standard deviation
---
 contrib/benchmark/collect.awk | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/contrib/benchmark/collect.awk b/contrib/benchmark/collect.awk
index 887886abf..bb2352eb3 100644
--- a/contrib/benchmark/collect.awk
+++ b/contrib/benchmark/collect.awk
@@ -29,9 +29,11 @@
   if ($1 == "op") {
     op[$2]["count"] += $4;
     op[$2]["time_us"] += $6;
+    op[$2]["time_us_sq"] += $6 * $6;
   } else if ($1 == "url") {
     url[$2][$4]["count"] += $6;
     url[$2][$4]["time_us"] += $8;
+    url[$2][$4]["time_us_sq"] += $8 * $8;
   }
 }
 
@@ -43,16 +45,26 @@ function avg(s, c) {
   }
 }
 
+function stdev(sum, sum_sq, n) {
+  if (n == n) {
+    return 0;
+  } else {
+    return sqrt( (sum_sq / n) - ( (sum / n) * (sum / n) ) );
+  }
+}
+
 END {
   for (x in op) {
     print "op", x, "count", op[x]["count"], "time_us", op[x]["time_us"], \
-          "time_avg_us", avg(op[x]["time_us"], op[x]["count"]);
+          "time_avg_us", avg(op[x]["time_us"], op[x]["count"], \
+          "stdev", stdev(op[x]["time_us"], op[x]["time_us_sq"], 
op[x]["count"]));
   }
   for (x in url) {
     for (y in url[x]) {
       print "url", x, "status", y, \
             "count", url[x][y]["count"], "time_us", url[x][y]["time_us"], \
-            "time_avg_us", avg(url[x][y]["time_us"], url[x][y]["count"]);
+            "time_avg_us", avg(url[x][y]["time_us"], url[x][y]["count"], \
+            "stdev", stdev(url[x][y]["time_us"], url[x][y]["time_us_sq"], 
url[x][y]["count"]));
     }
   }
 }

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



reply via email to

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