X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=resources%2Ftools%2Fpresentation%2Fgenerator_plots.py;h=40993cd477aa50728b6a906fd386ec6e9eec3156;hb=424b85712f4dd221524c20a9068567d0900d97f9;hp=74db877007e0b4bf9a392955d3af3df06ff4d28b;hpb=1d95c075ccd8b55d83fe3ae4f8e17df3b5dbd7d2;p=csit.git
diff --git a/resources/tools/presentation/generator_plots.py b/resources/tools/presentation/generator_plots.py
index 74db877007..40993cd477 100644
--- a/resources/tools/presentation/generator_plots.py
+++ b/resources/tools/presentation/generator_plots.py
@@ -314,8 +314,8 @@ def plot_hdrh_lat_by_percentile(plot, input_data):
filename=file_name)
# Add link to the file:
if file_links and target_links:
- with open(file_links, u"a") as fw:
- fw.write(
+ with open(file_links, u"a") as file_handler:
+ file_handler.write(
f"- `{name_link} "
f"<{target_links}/{file_name.split(u'/')[-1]}>`_\n"
)
@@ -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)