diff --git a/betree/haura-benchmarks/haura-plots/haura_plots/__init__.py b/betree/haura-benchmarks/haura-plots/haura_plots/__init__.py index 45cf5253..09cc15cc 100755 --- a/betree/haura-benchmarks/haura-plots/haura_plots/__init__.py +++ b/betree/haura-benchmarks/haura-plots/haura_plots/__init__.py @@ -285,7 +285,9 @@ def main(): # Grouped Plots for group in list({run["group"] for run in filter(lambda x: x is not None, ycsb_c)}): - ycsb_plots.plot_grouped_c(group, list(filter(lambda x: x["group"] == group, ycsb_c))) + ycsb_plots.plot_grouped_c(group, list(filter(lambda x: x is not None and x["group"] == group, ycsb_c))) + # Entire plot + ycsb_plots.plot_grouped_c('/'.join(sys.argv[1].split('/')[:-2]), list(filter(lambda x: x is not None, ycsb_c)), overall=True) if __name__ == "__main__": diff --git a/betree/haura-benchmarks/haura-plots/haura_plots/ycsb_plots.py b/betree/haura-benchmarks/haura-plots/haura_plots/ycsb_plots.py index 9d9cd8d2..c2a908fe 100644 --- a/betree/haura-benchmarks/haura-plots/haura_plots/ycsb_plots.py +++ b/betree/haura-benchmarks/haura-plots/haura_plots/ycsb_plots.py @@ -25,7 +25,7 @@ def plot_c(path): ax.set_ylabel("Throughput [op/s]") ax.set_title(f"YCSB-C Scaling | {' | '.join(path.split('/')[-2:])}") ax.set_xlabel("Threads [#]") - fig.legend() + ax.legend(loc='upper left') fig.savefig(f"{path}/ycsb_c.svg") return { "title": path.split('/')[-1:][0], @@ -34,7 +34,7 @@ def plot_c(path): "results": data["ops"] / (data["time_ns"] / 10**9), } -def plot_grouped_c(path, runs): +def plot_grouped_c(path, runs, overall=False): """ Bar chart for YCSB-C-esque scalability over multiple runs. """ @@ -44,14 +44,24 @@ def plot_grouped_c(path, runs): fig, ax = plt.subplots() off = 1 / (len(runs) + 1) for idx, run in enumerate(runs): + if not overall: + title = run["title"] + else: + group = run["group"].split('/')[-1:][0] + title = run["title"] + "[" + group + "]" ax.bar( [l - off * ((len(runs)-1)/2) + idx * off for l in run["threads"]], run["results"], off, - label=run["title"] + label=title ) - group = runs[0]["group"].split('/')[-1:][0] - ax.set_title(f'YCSB Scaling | {group}') + if not overall: + group = runs[0]["group"].split('/')[-1:][0] + ax.set_title(f'YCSB Scaling | {group}') + else: + ax.set_title(f'YCSB Scaling') + ax.set_ylabel("Throughput [op/s]") + ax.set_xlabel("Threads [#]") extra = fig.legend(loc="upper left", bbox_to_anchor=(0.9, 0.89)) fig.savefig(f"{path}/ycsb_c_comparison.svg", bbox_extra_artists=(extra,), bbox_inches="tight")