X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=resources%2Ftools%2Fpresentation%2Fgenerator_plots.py;h=0e0faff5bc37639676b342824794d8923a533289;hb=d68951ac245150eeefa6e0f4156e4c1b5c9e9325;hp=6fe1f287de4c4679ae296487804db2243f6c5efe;hpb=5979e1020d4e41e08f1fe4e6d195a0a5bc020bb1;p=csit.git diff --git a/resources/tools/presentation/generator_plots.py b/resources/tools/presentation/generator_plots.py index 6fe1f287de..0e0faff5bc 100644 --- a/resources/tools/presentation/generator_plots.py +++ b/resources/tools/presentation/generator_plots.py @@ -111,43 +111,30 @@ 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]], name=name, - 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) - + hoverinfo="y+name")) 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 @@ -237,9 +224,7 @@ def plot_performance_box_name(plot, input_data): traces.append(plgo.Box(x=[str(i + 1) + '.'] * len(df[col]), y=[y / 1000000 if y else None for y in df[col]], name=name, - hoverinfo="x+y", - boxpoints="outliers", - whiskerwidth=0)) + hoverinfo="y+name")) try: val_max = max(df[col]) except ValueError as err: @@ -297,7 +282,7 @@ def plot_latency_error_bars_name(plot, input_data): for test in build: try: logging.debug("test['latency']: {0}\n". - format(test["latency"])) + format(test["latency"])) except ValueError as err: logging.warning(repr(err)) if y_tmp_vals.get(test["parent"], None) is None: @@ -1792,9 +1777,9 @@ def plot_service_density_heatmap(plot, input_data): """ REGEX_CN = re.compile(r'^(\d*)R(\d*)C$') - REGEX_TEST_NAME = re.compile(r'^.*-(\d+vhost|\d+memif)-' - r'(\d+chain|\d+pipe)-' - r'(\d+vm|\d+dcr|\d+drc).*$') + REGEX_TEST_NAME = re.compile(r'^.*-(\d+ch|\d+pl)-' + r'(\d+mif|\d+vh)-' + r'(\d+vm\d+t|\d+dcr\d+t).*$') txt_chains = list() txt_nodes = list() @@ -1821,9 +1806,9 @@ def plot_service_density_heatmap(plot, input_data): continue groups = re.search(REGEX_TEST_NAME, test["name"]) if groups and len(groups.groups()) == 3: - hover_name = "{vhost}-{chain}-{vm}".format( - vhost=str(groups.group(1)), - chain=str(groups.group(2)), + hover_name = "{chain}-{vhost}-{vm}".format( + chain=str(groups.group(1)), + vhost=str(groups.group(2)), vm=str(groups.group(3))) else: hover_name = "" @@ -2076,8 +2061,8 @@ def plot_service_density_heatmap_compare(plot, input_data): REGEX_CN = re.compile(r'^(\d*)R(\d*)C$') REGEX_TEST_NAME = re.compile(r'^.*-(\d+ch|\d+pl)-' - r'(\d+vh|\d+mif)-' - r'(\d+vm|\d+dcr).*$') + r'(\d+mif|\d+vh)-' + r'(\d+vm\d+t|\d+dcr\d+t).*$') REGEX_THREADS = re.compile(r'^(\d+)(VM|DCR)(\d+)T$') txt_chains = list()