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: fix stdev


From: gnunet
Subject: [GNUnet-SVN] [gnunet] branch master updated: benchmark: fix stdev
Date: Mon, 24 Sep 2018 19:30:04 +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 58a12be5d benchmark: fix stdev
58a12be5d is described below

commit 58a12be5d2843d76c185d93c690a8e6d835824fc
Author: Florian Dold <address@hidden>
AuthorDate: Mon Sep 24 19:28:28 2018 +0200

    benchmark: fix stdev
---
 contrib/benchmark/collect.awk | 22 +++++++++++++---------
 1 file changed, 13 insertions(+), 9 deletions(-)

diff --git a/contrib/benchmark/collect.awk b/contrib/benchmark/collect.awk
index 3853936bd..12ece0ebf 100644
--- a/contrib/benchmark/collect.awk
+++ b/contrib/benchmark/collect.awk
@@ -27,21 +27,25 @@
 # url <url> status <status> count <count> time_us <time_us>
 {
   if ($1 == "op") {
-    op[$2]["count"] += $4;
-    op[$2]["time_us"] += $6;
-    op[$2]["time_us_sq"] += $6 * $6;
+    n = $4;
+    t = $6;
+    op[$2]["count"] += n;
+    op[$2]["time_us"] += t;
+    op[$2]["time_us_sq"] += n * (t/n) * (t/n);
   } else if ($1 == "url") {
-    url[$2][$4]["count"] += $6;
-    url[$2][$4]["time_us"] += $8;
-    url[$2][$4]["time_us_sq"] += $8 * $8;
+    n = $6;
+    t = $8;
+    url[$2][$4]["count"] += n;
+    url[$2][$4]["time_us"] += t;
+    url[$2][$4]["time_us_sq"] += n * (t/n) * (t/n);
   }
 }
 
-function avg(s, c) {
-  if (c == 0) {
+function avg(sum, n) {
+  if (n == 0) {
     return 0;
   } else {
-    return s / c;
+    return 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]