X-Git-Url: https://gerrit.fd.io/r/gitweb?p=csit.git;a=blobdiff_plain;f=resources%2Ftools%2Fpresentation%2Fgenerator_plots.py;h=8161a5a5664fd1bd1eebeced27310aaddb3e2dfd;hp=1bfbda1a1bf8fb597e26c82650a07bc4952c2d27;hb=bb1a7058e8bbcbe998fdfd8dd5ed46e13fb90db7;hpb=093e1a0bfa7257048e6d12fe9fc9fbf1a9f98e49 diff --git a/resources/tools/presentation/generator_plots.py b/resources/tools/presentation/generator_plots.py index 1bfbda1a1b..8161a5a566 100644 --- a/resources/tools/presentation/generator_plots.py +++ b/resources/tools/presentation/generator_plots.py @@ -18,16 +18,16 @@ import re import logging +from collections import OrderedDict +from copy import deepcopy +from math import log + import hdrh.histogram import hdrh.codec import pandas as pd import plotly.offline as ploff import plotly.graph_objs as plgo -from collections import OrderedDict -from copy import deepcopy -from math import log - from plotly.exceptions import PlotlyError from pal_utils import mean, stdev @@ -91,7 +91,7 @@ def generate_plots(spec, data): for index, plot in enumerate(spec.plots): try: logging.info(f" Plot nr {index + 1}: {plot.get(u'title', u'')}") - plot[u"limits"] = spec.configuration[u"limits"] + plot[u"limits"] = spec.environment[u"limits"] generator[plot[u"algorithm"]](plot, data) logging.info(u" Done.") except NameError as err: @@ -200,7 +200,8 @@ def plot_hdrh_lat_by_percentile(plot, input_data): hovertext.append( f"{desc[graph]}
" f"Direction: {(u'W-E', u'E-W')[idx % 2]}
" - f"Percentile: {previous_x:.5f}-{percentile:.5f}%
" + f"Percentile: " + f"{previous_x:.5f}-{percentile:.5f}%
" f"Latency: {item.value_iterated_to}uSec" ) xaxis.append(percentile) @@ -208,7 +209,8 @@ def plot_hdrh_lat_by_percentile(plot, input_data): hovertext.append( f"{desc[graph]}
" f"Direction: {(u'W-E', u'E-W')[idx % 2]}
" - f"Percentile: {previous_x:.5f}-{percentile:.5f}%
" + f"Percentile: " + f"{previous_x:.5f}-{percentile:.5f}%
" f"Latency: {item.value_iterated_to}uSec" ) previous_x = percentile @@ -351,7 +353,7 @@ def plot_hdrh_lat_by_percentile_x_log(plot, input_data): decoded = hdrh.histogram.HdrHistogram.decode( test[u"latency"][graph][direction][u"hdrh"] ) - except hdrh.codec.HdrLengthException: + except (hdrh.codec.HdrLengthException, TypeError): logging.warning( f"No data for direction {(u'W-E', u'E-W')[idx % 2]}" ) @@ -604,6 +606,19 @@ def plot_perf_box_name(plot, input_data): ) test_type = u"HOSTSTACK" + elif test[u"type"] in (u"LDP_NGINX",): + if u"TCP_CPS" in test[u"tags"]: + test_type = u"VSAP_CPS" + y_vals[test[u"parent"]].append( + test[u"result"][u"cps"] / 1e6 + ) + elif u"TCP_RPS" in test[u"tags"]: + test_type = u"VSAP_RPS" + y_vals[test[u"parent"]].append( + test[u"result"][u"rps"] / 1e6 + ) + else: + continue else: continue @@ -660,6 +675,12 @@ def plot_perf_box_name(plot, input_data): if layout.get(u"title", None): if test_type in (u"HOSTSTACK", ): layout[u"title"] = f"Bandwidth: {layout[u'title']}" + elif test_type == u"VSAP_CPS": + layout[u"title"] = f"CPS: {layout[u'title']}" + layout[u"yaxis"][u"title"] = u"Connection Rate [Mcps]" + elif test_type == u"VSAP_RPS": + layout[u"title"] = f"RPS: {layout[u'title']}" + layout[u"yaxis"][u"title"] = u"Connection Rate [Mrps]" else: layout[u"title"] = f"Throughput: {layout[u'title']}" if y_max: @@ -761,8 +782,10 @@ def plot_ndrpdr_box_name(plot, input_data): hoverinfo=u"y+name" ) ) - data_y_max.append(max(vals)) - + try: + data_y_max.append(max(vals)) + except ValueError as err: + logging.warning(f"No values to use.\n{err!r}") try: # Create plot layout = deepcopy(plot[u"layout"]) @@ -853,10 +876,10 @@ def plot_mrr_box_name(plot, input_data): # Add plot traces traces = list() - for idx in range(len(data_x)): + for idx, x_item in enumerate(data_x): traces.append( plgo.Box( - x=[data_x[idx], ] * len(data_y[idx]), + x=[x_item, ] * len(data_y[idx]), y=data_y[idx], name=data_names[idx], hoverinfo=u"y+name" @@ -986,7 +1009,7 @@ def plot_tsa_name(plot, input_data): REGEX_NIC, u"", test_name.replace(u'-ndrpdr', u''). - replace(u'2n1l-', u'') + replace(u'2n1l-', u'') ) vals[name] = OrderedDict() y_val_1 = test_vals[u"1"][0] / 1e6 @@ -1046,6 +1069,8 @@ def plot_tsa_name(plot, input_data): limit = plot[u"limits"][u"nic"][u"x553"] elif u"cx556a" in test_name: limit = plot[u"limits"][u"nic"][u"cx556a"] + elif u"e810cq" in test_name: + limit = plot[u"limits"][u"nic"][u"e810cq"] else: limit = 0 if limit > nic_limit: