X-Git-Url: https://gerrit.fd.io/r/gitweb?p=csit.git;a=blobdiff_plain;f=resources%2Ftools%2Fpresentation%2Fgenerator_plots.py;h=25a3736a260ada209e07d3f1248daa8116e6206c;hp=3e5da63c9e53a651d221f3d0cb4cba6ee2d99330;hb=60ecfa318740f00e009e9611be2390fbef5fe92d;hpb=38201acbd8778f30e31909c952adc9a895d75fa6 diff --git a/resources/tools/presentation/generator_plots.py b/resources/tools/presentation/generator_plots.py index 3e5da63c9e..25a3736a26 100644 --- a/resources/tools/presentation/generator_plots.py +++ b/resources/tools/presentation/generator_plots.py @@ -111,20 +111,18 @@ def plot_service_density_reconf_box_name(plot, input_data): traces = list() df = pd.DataFrame(y_vals) df.head() - y_max = list() for i, col in enumerate(df.columns): tst_name = re.sub(REGEX_NIC, "", col.lower().replace('-ndrpdr', ''). replace('2n1l-', '')) tst_name = "-".join(tst_name.split("-")[3:-2]) - name = "{nr}. ({samples:02d} run{plural}, avg pkt loss: {loss:.1f}, " \ - "stdev: {stdev:.2f}) {name}".format( + name = "{nr}. ({samples:02d} run{plural}, packets lost average: " \ + "{loss:.1f}, {name}".format( nr=(i + 1), samples=nr_of_samples[i], plural='s' if nr_of_samples[i] > 1 else '', name=tst_name, - loss=mean(loss[col]) / 1000000, - stdev=stdev(loss[col]) / 1000000) + loss=mean(loss[col])) traces.append(plgo.Box(x=[str(i + 1) + '.'] * len(df[col]), y=[y if y else None for y in df[col]], @@ -132,22 +130,13 @@ def plot_service_density_reconf_box_name(plot, input_data): hoverinfo="x+y", boxpoints="outliers", whiskerwidth=0)) - try: - val_max = max(df[col]) - except ValueError as err: - logging.error(repr(err)) - continue - if val_max: - y_max.append(int(val_max) + 1) - try: # Create plot layout = deepcopy(plot["layout"]) layout["title"] = "Time Lost: {0}".format(layout["title"]) layout["yaxis"]["title"] = "Implied Time Lost [s]" layout["legend"]["font"]["size"] = 14 - if y_max: - layout["yaxis"]["range"] = [0, max(y_max)] + layout["yaxis"].pop("range") plpl = plgo.Figure(data=traces, layout=layout) # Export Plot