From 3de166e89c8bcf908903a9efb31e375db96a3191 Mon Sep 17 00:00:00 2001 From: Tpt Date: Mon, 7 Oct 2019 11:26:47 +0200 Subject: [PATCH] BSBM benchmark: plot also business intelligence use care --- bench/bsbm-plot.py | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/bench/bsbm-plot.py b/bench/bsbm-plot.py index a3527144..2fab3a87 100644 --- a/bench/bsbm-plot.py +++ b/bench/bsbm-plot.py @@ -5,6 +5,7 @@ from glob import glob def plot_y_per_x_per_plot(data, xlabel, ylabel, file): + plt.figure(file) for label, xys in data.items(): plt.plot(list(xys.keys()), list(xys.values()), '.', label=label) plt.legend() @@ -12,9 +13,9 @@ def plot_y_per_x_per_plot(data, xlabel, ylabel, file): plt.ylabel(ylabel) # plt.yscale('log') plt.savefig(file) - plt.show() +# BSBM explore aqet = defaultdict(dict) for file in glob('bsbm.explore.*.xml'): run = file.replace('bsbm.explore.', '').replace('.xml', '') @@ -22,5 +23,16 @@ for file in glob('bsbm.explore.*.xml'): val = float(query.find('aqet').text) if val > 0: aqet[run][int(query.attrib['nr'])] = val - plot_y_per_x_per_plot(aqet, 'query id', 'aqet', 'bsbm.explore.png') + +# BSBM business intelligence +aqet = defaultdict(dict) +for file in glob('bsbm.businessIntelligence.*.xml'): + run = file.replace('bsbm.businessIntelligence.', '').replace('.xml', '') + for query in ET.parse(file).getroot().find('queries').findall('query'): + val = float(query.find('aqet').text) + if val > 0: + aqet[run][int(query.attrib['nr'])] = val +plot_y_per_x_per_plot(aqet, 'query id', 'aqet', 'bsbm.businessIntelligence.png') + +plt.show()