X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=resources%2Ftools%2Fpresentation%2Fgenerator_plots.py;h=cc9d880398aedc69dc5f2a60b4df561b8fcda10e;hb=6aecd61f0808c995d0003272f2ef2da7ea0fca26;hp=661823cac15de234d492db37d3fe8a4e177c69e0;hpb=80e8f662317324156f9997e788f7ed2ae46401f8;p=csit.git diff --git a/resources/tools/presentation/generator_plots.py b/resources/tools/presentation/generator_plots.py index 661823cac1..cc9d880398 100644 --- a/resources/tools/presentation/generator_plots.py +++ b/resources/tools/presentation/generator_plots.py @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Cisco and/or its affiliates. +# Copyright (c) 2023 Cisco and/or its affiliates. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at: @@ -777,7 +777,6 @@ def plot_perf_box_name(plot, input_data): else: data_y = [y / 1e6 if y else None for y in df_y[col]] kwargs = dict( - x=[str(i + 1) + u'.'] * len(df_y[col]), y=data_y, name=( f"{i + 1}. " @@ -789,13 +788,17 @@ def plot_perf_box_name(plot, input_data): ) if test_type in (u"SOAK", ): kwargs[u"boxpoints"] = u"all" + kwargs[u"jitter"] = 0.3 traces.append(plgo.Box(**kwargs)) try: val_max = max(df_y[col]) if val_max: - y_max.append(int(val_max / 1e6)) + if test_type in (u"VSAP_CPS", u"VSAP_RPS"): + y_max.append(int(val_max)) + else: + y_max.append(int(val_max / 1e6)) except (ValueError, TypeError) as err: logging.error(repr(err)) continue @@ -803,6 +806,8 @@ def plot_perf_box_name(plot, input_data): try: # Create plot layout = deepcopy(plot[u"layout"]) + layout[u"xaxis"][u"tickvals"] = [i for i in range(len(y_vals))] + layout[u"xaxis"][u"ticktext"] = [str(i + 1) for i in range(len(y_vals))] if layout.get(u"title", None): if test_type in (u"HOSTSTACK", ): layout[u"title"] = f"Bandwidth: {layout[u'title']}" @@ -899,20 +904,23 @@ def plot_ndrpdr_box_name(plot, input_data): REGEX_NIC, u'', key.lower().replace(u'-ndrpdr', u''). replace(u'2n1l-', u'') ) - traces.append( - plgo.Box( - x=[data_x[idx], ] * len(data_x), - y=[y / 1e6 if y else None for y in vals], - name=( - f"{idx+1}." - f"({len(vals):02d} " - f"run" - f"{u's' if len(vals) > 1 else u''}) " - f"{name}" - ), - hoverinfo=u"y+name" - ) + kwargs = dict( + y=[y / 1e6 if y else None for y in vals], + name=( + f"{idx + 1}." + f"({len(vals):02d} " + f"run" + f"{u's' if len(vals) > 1 else u''}) " + f"{name}" + ), + hoverinfo=u"y+name" ) + box_points = plot.get(u"boxpoints", u"all") + if box_points in \ + (u"all", u"outliers", u"suspectedoutliers", False): + kwargs[u"boxpoints"] = box_points + kwargs[u"jitter"] = 0.3 + traces.append(plgo.Box(**kwargs)) try: data_y_max.append(max(vals)) except ValueError as err: @@ -920,6 +928,9 @@ def plot_ndrpdr_box_name(plot, input_data): try: # Create plot layout = deepcopy(plot[u"layout"]) + layout[u"xaxis"][u"tickvals"] = [i for i in range(len(data_y))] + layout[u"xaxis"][u"ticktext"] = \ + [str(i + 1) for i in range(len(data_y))] if layout.get(u"title", None): layout[u"title"] = \ layout[u'title'].format(core=core, test_type=ttype) @@ -1008,18 +1019,23 @@ def plot_mrr_box_name(plot, input_data): # Add plot traces traces = list() for idx, x_item in enumerate(data_x): - traces.append( - plgo.Box( - x=[x_item, ] * len(data_y[idx]), - y=data_y[idx], - name=data_names[idx], - hoverinfo=u"y+name" - ) + kwargs = dict( + y=data_y[idx], + name=data_names[idx], + hoverinfo=u"y+name" ) + box_points = plot.get(u"boxpoints", u"all") + if box_points in (u"all", u"outliers", u"suspectedoutliers", False): + kwargs[u"boxpoints"] = box_points + kwargs["jitter"] = 0.3 + traces.append(plgo.Box(**kwargs)) try: # Create plot layout = deepcopy(plot[u"layout"]) + layout[u"xaxis"][u"tickvals"] = [i for i in range(len(data_y))] + layout[u"xaxis"][u"ticktext"] = \ + [str(i + 1) for i in range(len(data_y))] if layout.get(u"title", None): layout[u"title"] = ( f"Tput: {layout[u'title'].format(core=core)}" @@ -1202,6 +1218,10 @@ def plot_tsa_name(plot, input_data): limit = plot[u"limits"][u"nic"][u"cx556a"] elif u"e810cq" in test_name: limit = plot[u"limits"][u"nic"][u"e810cq"] + elif u"e810xxv" in test_name: + limit = plot[u"limits"][u"nic"][u"e810xxv"] + elif u"e822cq" in test_name: + limit = plot[u"limits"][u"nic"][u"e822cq"] else: limit = 0 if limit > nic_limit: