benchmark: output adjusted total time
authorFlorian Dold <florian.dold@gmail.com>
Thu, 27 Sep 2018 13:25:53 +0000 (15:25 +0200)
committerFlorian Dold <florian.dold@gmail.com>
Thu, 27 Sep 2018 13:25:53 +0000 (15:25 +0200)
contrib/benchmark/collect.awk

index 46ec23d4200b93468bfdc8c174d84d12f5e65d59..b88b3dc7da5eab738764defb7910b518c30df0d2 100644 (file)
@@ -51,6 +51,11 @@ function abs(v) {
     }
     max = url[$2][$4]["time_us_max"];
     url[$2][$4]["time_us_max"] = (t/n > max ? t/n : max)
+  } else if ($1 == "op_baseline") {
+    # take average time for operations from baseline values with format:
+    # op_baseline <opname> time_avg_us <t>
+    op_baseline[$2] = $4;
+    have_baseline = 1;
   }
 }
 
@@ -95,4 +100,13 @@ END {
       print "op_baseline", x, "time_avg_us", avg(op[x]["time_us"], op[x]["count"]) > baseline_out
     }
   }
+
+  if (have_baseline) {
+    for (x in op) {
+      total_ops_adjusted[x] = op_baseline[x] * op[x]["count"];
+    }
+    for (x in op) {
+      print "total_ops_adjusted_ms", total_ops_adjusted[x];
+    }
+  }
 }