X-Git-Url: https://gerrit.fd.io/r/gitweb?p=csit.git;a=blobdiff_plain;f=resources%2Ftools%2Fpresentation%2Fgenerator_plots.py;h=40993cd477aa50728b6a906fd386ec6e9eec3156;hp=5c9698912ff3eee0b88a4d60e2a2a354bc940c15;hb=refs%2Fchanges%2F40%2F25340%2F27;hpb=1629fedabe77aef4f31ca4f3fbf5f66d1ec274dd diff --git a/resources/tools/presentation/generator_plots.py b/resources/tools/presentation/generator_plots.py index 5c9698912f..40993cd477 100644 --- a/resources/tools/presentation/generator_plots.py +++ b/resources/tools/presentation/generator_plots.py @@ -622,13 +622,14 @@ def plot_perf_box_name(plot, input_data): f"{plot.get(u'title', u'')}." ) data = input_data.filter_tests_by_name( - plot, params=[u"throughput", u"parent", u"tags", u"type"]) + plot, params=[u"throughput", u"result", u"parent", u"tags", u"type"]) if data is None: logging.error(u"No data.") return # Prepare the data for the plot y_vals = OrderedDict() + test_type = u"" for job in data: for build in job: for test in build: @@ -639,13 +640,30 @@ def plot_perf_box_name(plot, input_data): u"-pdr" in plot.get(u"title", u"").lower()): y_vals[test[u"parent"]].\ append(test[u"throughput"][u"PDR"][u"LOWER"]) + test_type = u"NDRPDR" elif (test[u"type"] in (u"NDRPDR", ) and u"-ndr" in plot.get(u"title", u"").lower()): y_vals[test[u"parent"]]. \ append(test[u"throughput"][u"NDR"][u"LOWER"]) + test_type = u"NDRPDR" elif test[u"type"] in (u"SOAK", ): y_vals[test[u"parent"]].\ append(test[u"throughput"][u"LOWER"]) + test_type = u"SOAK" + elif test[u"type"] in (u"HOSTSTACK", ): + if u"LDPRELOAD" in test[u"tags"]: + y_vals[test[u"parent"]].append( + float(test[u"result"][u"bits_per_second"]) / 1e3 + ) + elif u"VPPECHO" in test[u"tags"]: + y_vals[test[u"parent"]].append( + (float(test[u"result"][u"client"][u"tx_data"]) + * 8 / 1e3) / + ((float(test[u"result"][u"client"][u"time"]) + + float(test[u"result"][u"server"][u"time"])) / + 2) + ) + test_type = u"HOSTSTACK" else: continue except (KeyError, TypeError): @@ -696,7 +714,10 @@ def plot_perf_box_name(plot, input_data): # Create plot layout = deepcopy(plot[u"layout"]) if layout.get(u"title", None): - layout[u"title"] = f"Throughput: {layout[u'title']}" + if test_type in (u"HOSTSTACK", ): + layout[u"title"] = f"Bandwidth: {layout[u'title']}" + else: + layout[u"title"] = f"Throughput: {layout[u'title']}" if y_max: layout[u"yaxis"][u"range"] = [0, max(y_max)] plpl = plgo.Figure(data=traces, layout=layout)