From 51ba31ed4a2548fb12d9e1e2f2115213a0aaa1f4 Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Wed, 22 Aug 2018 19:12:43 +0200 Subject: add histogram results to the results dict and fix summary --- mysql.py | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) (limited to 'mysql.py') diff --git a/mysql.py b/mysql.py index af65dd6..d1871f7 100644 --- a/mysql.py +++ b/mysql.py @@ -186,10 +186,10 @@ class Benchmark_MYSQL( Benchmark ): result["rssmax"] = l.replace("VmHWM:", "").strip().split()[0] break - if not thread in self.results: - self.results[tname][thread] = [result] - else: - self.results[tname][thread].append(result) + if not thread in self.results: + self.results[tname][thread] = [result] + else: + self.results[tname][thread].append(result) print() @@ -246,16 +246,17 @@ class Benchmark_MYSQL( Benchmark ): plt.clf() # Histogram - for mid, measures in self.results.items(): - if mid[0] == "chattymalloc": - hist = [(n, s) for s,n in measures[0]["hist"].items()] - hist.sort() - print("Histogram for", mid[1], "threads:") - print(hist) + del(self.results["chattymalloc"]["heap_start"]) + for thread, measures in self.results["chattymalloc"].items(): + print(measures) + hist = [(n, s) for s, n in measures[0]["hist"].items()] + hist.sort() + print("Histogram for", thread, "threads:") + print(hist) # Memusage y_mapping = {v : i for i, v in enumerate(nthreads)} - for target in targets: + for target in [t for t in targets if t != "chattymalloc"]: y_vals = [0] * len(nthreads) for thread, measures in [(t, d) for t, d in self.results[target].items() if t != "heap_start"]: d = [int(m["rssmax"]) for m in measures] -- cgit v1.2.3