aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xbench.py5
-rw-r--r--falsesharing.py6
-rw-r--r--mysql.py8
3 files changed, 14 insertions, 5 deletions
diff --git a/bench.py b/bench.py
index 6f16428..88e8413 100755
--- a/bench.py
+++ b/bench.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python3
import argparse
+import os
import common_targets
@@ -16,6 +17,7 @@ parser.add_argument("-r", "--runs", help="how often the benchmarks run", default
parser.add_argument("-v", "--verbose", help="more output", action='store_true')
parser.add_argument("-b", "--benchmarks", help="benchmarks to run", nargs='+')
parser.add_argument("-ns", "--nosum", help="don't produce plots", action='store_true')
+parser.add_argument("-sd", "--summarydir", help="directory where all plots and the summary go", type=str)
parser.add_argument("-a", "--analyse", help="collect allocation sizes", action='store_true')
@@ -25,6 +27,9 @@ def main():
args = parser.parse_args()
print (args)
+ if args.summarydir and not os.path.isdir(args.summarydir):
+ os.makedirs(args.summarydir)
+
for bench in benchmarks:
if args.benchmarks and not bench.name in args.benchmarks:
continue
diff --git a/falsesharing.py b/falsesharing.py
index b5d7a9f..f42a849 100644
--- a/falsesharing.py
+++ b/falsesharing.py
@@ -102,11 +102,13 @@ class Benchmark_Falsesharing( Benchmark ):
print()
return True
- def summary(self):
+ def summary(self, sd=None):
# Speedup thrash
nthreads = self.results["args"]["nthreads"]
targets = self.results["targets"]
+ sd = sd or ""
+
y_mapping = {v : i for i, v in enumerate(nthreads)}
for bench in ["thrash", "scratch"]:
for target in targets:
@@ -135,7 +137,7 @@ class Benchmark_Falsesharing( Benchmark ):
plt.xlabel("threads")
plt.ylabel("speedup")
plt.title(bench)
- plt.savefig(self.name + "." + bench + ".png")
+ plt.savefig(os.path.join(sd, self.name + "." + bench + ".png"))
plt.clf()
falsesharing= Benchmark_Falsesharing()
diff --git a/mysql.py b/mysql.py
index 45ba6b6..6818170 100644
--- a/mysql.py
+++ b/mysql.py
@@ -198,12 +198,14 @@ class Benchmark_MYSQL( Benchmark ):
return True
- def summary(self):
+ def summary(self, sd=None):
# linear plot
nthreads = self.results["args"]["nthreads"]
targets = self.results["targets"]
y_mapping = {v: i for i, v in enumerate(nthreads)}
+ sd = sd or ""
+
for target in targets:
if target == "chattymalloc":
continue
@@ -220,7 +222,7 @@ class Benchmark_MYSQL( Benchmark ):
plt.xlabel("threads")
plt.ylabel("transactions")
plt.title("sysbench oltp read only")
- plt.savefig(self.name + ".l.ro.png")
+ plt.savefig(os.path.join(sd,self.name + ".l.ro.png"))
plt.clf()
# bar plot
@@ -246,7 +248,7 @@ class Benchmark_MYSQL( Benchmark ):
plt.xticks(range(1, len(nthreads) + 1), nthreads)
plt.ylabel("transactions")
plt.title("sysbench oltp read only")
- plt.savefig(self.name + ".b.ro.png")
+ plt.savefig(os.path.join(sd, self.name + ".b.ro.png"))
plt.clf()
for mid, measures in self.results.items():