aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Fischer <muhq@muhq.space>2019-03-19 03:53:59 +0100
committerFlorian Fischer <muhq@muhq.space>2019-03-19 03:54:54 +0100
commit65452ff03e4029c629075776306b8c10c378da98 (patch)
tree41957f03d92056e64e992d776300d7feb0bcacc0
parentc23a93cb1fff07653d491e7967a713455c7d2555 (diff)
downloadallocbench-65452ff03e4029c629075776306b8c10c378da98.tar.gz
allocbench-65452ff03e4029c629075776306b8c10c378da98.zip
add normalized plots to mysql benchmark
-rw-r--r--src/mysql.py40
1 files changed, 40 insertions, 0 deletions
diff --git a/src/mysql.py b/src/mysql.py
index a3ef708..de30141 100644
--- a/src/mysql.py
+++ b/src/mysql.py
@@ -168,6 +168,16 @@ class Benchmark_MYSQL(Benchmark):
title='"sysbench oltp read only"',
filepostfix="l.ro")
+
+ # linear plot
+ ref_alloc = list(allocators)[0]
+ self.plot_single_arg("{transactions}",
+ xlabel='"threads"',
+ ylabel='"transactions scaled at " + scale',
+ title='"sysbench oltp read only"',
+ filepostfix="norm.l.ro",
+ scale=ref_alloc)
+
# bar plot
for i, allocator in enumerate(allocators):
y_vals = []
@@ -186,6 +196,36 @@ class Benchmark_MYSQL(Benchmark):
plt.savefig(self.name + ".b.ro.png")
plt.clf()
+ # normalized bar plot
+ norm_y_vals = []
+ for perm in self.iterate_args(args=self.results["args"]):
+ d = [int(m["transactions"]) for m in self.results[ref_alloc][perm]]
+ norm_y_vals.append(np.mean(d))
+
+ nallocs = len(allocators)
+ x_vals = [x for x in range(1, len(norm_y_vals)*nallocs + 1, nallocs)]
+ plt.bar(x_vals, [1]*len(norm_y_vals), width=0.7, label=ref_alloc,
+ align="center", color=allocators[ref_alloc]["color"])
+
+ for i, allocator in enumerate(list(allocators)[1:]):
+ y_vals = []
+ for y, perm in enumerate(self.iterate_args(args=self.results["args"])):
+ d = [int(m["transactions"]) for m in self.results[allocator][perm]]
+ y_vals.append(np.mean(d) / norm_y_vals[y])
+
+ x_vals = [x+i+1 for x in range(1, len(norm_y_vals)*nallocs + 1, nallocs)]
+
+ plt.bar(x_vals, y_vals, width=0.7, label=allocator, align="center",
+ color=allocators[allocator]["color"])
+
+ plt.legend()
+ plt.xlabel("threads")
+ plt.xticks(range(1, (len(y_vals) + 1)*3, 3), self.results["args"]["nthreads"])
+ plt.ylabel("transactions normalized")
+ plt.title("sysbench oltp read only")
+ plt.savefig(self.name + ".norm.b.ro.png")
+ plt.clf()
+
# Memusage
self.plot_single_arg("{rssmax}",
xlabel='"threads"',