diff --git a/betree/haura-benchmarks/haura-plots/haura_plots/__init__.py b/betree/haura-benchmarks/haura-plots/haura_plots/__init__.py index 26ea2d3d..4fcac1f3 100755 --- a/betree/haura-benchmarks/haura-plots/haura_plots/__init__.py +++ b/betree/haura-benchmarks/haura-plots/haura_plots/__init__.py @@ -218,8 +218,20 @@ def plot_evaluation_latency(path, variant): fig, ax = plt.subplots(1,1,figsize=(6,4)) reads = data[data['op'] == 'r'] writes = data[data['op'] == 'w'] - ax.scatter(reads['size'], reads['latency_ns'], marker='x', label="read") - ax.scatter(writes['size'], writes['latency_ns'], marker='.', label="write") + if len(reads) > 0: + ax.scatter(reads['size'], reads['latency_ns'], marker='x', label="read") + size = reads['size'].to_numpy() + latency = reads['latency_ns'].to_numpy() + p = np.polynomial.Polynomial.fit(size, latency, 1) + size.sort() + ax.plot(size, p(size), linestyle=':', label='read trend', color='black') + if len(writes) > 0: + ax.scatter(writes['size'], writes['latency_ns'], marker='.', label="write") + size = writes['size'].to_numpy() + latency = writes['latency_ns'].to_numpy() + p = np.polynomial.Polynomial.fit(size, latency, 1) + size.sort() + ax.plot(size, p(size), linestyle='-.', label='write trend', color='black') xticks = np.arange(0, 12 * 1024 * 1024 + 1, 2 * 1024 * 1024) ax.set_xticks(xticks, [int(x / 1024) for x in xticks]) ax.set_xlabel("Size in KiB") diff --git a/betree/haura-benchmarks/haura-plots/haura_plots/metrics_plots.py b/betree/haura-benchmarks/haura-plots/haura_plots/metrics_plots.py index ebc6187c..245bc150 100644 --- a/betree/haura-benchmarks/haura-plots/haura_plots/metrics_plots.py +++ b/betree/haura-benchmarks/haura-plots/haura_plots/metrics_plots.py @@ -146,3 +146,4 @@ def plot_system(path): fig.tight_layout() fig.savefig(f"{path}/proc.svg") + plt.close(fig)