+ tput_traces = list()
+ y_tput_max = 0
+ lat_traces = list()
+ y_lat_max = 0
+ x_lat = list()
+ show_latency = False
+ show_tput = False
+ for idx, itm in enumerate(sel):
+ itm_data = select_iterative_data(data, itm)
+ if itm_data.empty:
+ continue
+ if itm["testtype"] == "mrr":
+ y_data = itm_data[_VALUE[itm["testtype"]]].to_list()[0]
+ if y_data.size > 0:
+ y_tput_max = \
+ max(y_data) if max(y_data) > y_tput_max else y_tput_max
+ else:
+ y_data = itm_data[_VALUE[itm["testtype"]]].to_list()
+ if y_data:
+ y_tput_max = \
+ max(y_data) if max(y_data) > y_tput_max else y_tput_max
+ nr_of_samples = len(y_data)
+ tput_kwargs = dict(
+ y=y_data,
+ name=(
+ f"{idx + 1}. "
+ f"({nr_of_samples:02d} "
+ f"run{'s' if nr_of_samples > 1 else ''}) "
+ f"{itm['id']}"
+ ),
+ hoverinfo=u"y+name",
+ boxpoints="all",
+ jitter=0.3,
+ marker=dict(color=_get_color(idx))
+ )
+ tput_traces.append(go.Box(**tput_kwargs))
+ show_tput = True
+
+ if itm["testtype"] == "pdr":
+ y_lat = itm_data[_VALUE["pdr-lat"]].to_list()
+ if y_lat:
+ y_lat_max = max(y_lat) if max(y_lat) > y_lat_max else y_lat_max
+ nr_of_samples = len(y_lat)
+ lat_kwargs = dict(
+ y=y_lat,
+ name=(
+ f"{idx + 1}. "
+ f"({nr_of_samples:02d} "
+ f"run{u's' if nr_of_samples > 1 else u''}) "
+ f"{itm['id']}"
+ ),
+ hoverinfo="all",
+ boxpoints="all",
+ jitter=0.3,
+ marker=dict(color=_get_color(idx))
+ )
+ x_lat.append(idx + 1)
+ lat_traces.append(go.Box(**lat_kwargs))
+ show_latency = True
+ else:
+ lat_traces.append(go.Box())
+
+ if show_tput:
+ pl_tput = deepcopy(layout["plot-throughput"])
+ pl_tput["xaxis"]["tickvals"] = [i for i in range(len(sel))]
+ pl_tput["xaxis"]["ticktext"] = [str(i + 1) for i in range(len(sel))]
+ if y_tput_max:
+ pl_tput["yaxis"]["range"] = [0, (int(y_tput_max / 1e6) + 1) * 1e6]
+ fig_tput = go.Figure(data=tput_traces, layout=pl_tput)
+
+ if show_latency:
+ pl_lat = deepcopy(layout["plot-latency"])
+ pl_lat["xaxis"]["tickvals"] = [i for i in range(len(x_lat))]
+ pl_lat["xaxis"]["ticktext"] = x_lat
+ if y_lat_max:
+ pl_lat["yaxis"]["range"] = [0, (int(y_lat_max / 10) + 1) * 10]
+ fig_lat = go.Figure(data=lat_traces, layout=pl_lat)
+
+ return fig_tput, fig_lat