+ logging.warning(f"Invalid test type: {test[u'type']}")
+ continue
+ name = re.sub(REGEX_NIC, u"", test[u"parent"].
+ replace(u'-ndrpdr', u'').
+ replace(u'2n1l-', u''))
+ histograms = list()
+ for idx_col, direction in enumerate(
+ (u"direction1", u"direction2", )):
+ try:
+ hdr_lat = test[u"latency"][ttype][direction][u"hdrh"]
+ # TODO: Workaround, HDRH data must be aligned to 4
+ # bytes, remove when not needed.
+ hdr_lat += u"=" * (len(hdr_lat) % 4)
+ xaxis = list()
+ yaxis = list()
+ hovertext = list()
+ decoded = hdrh.histogram.HdrHistogram.decode(hdr_lat)
+ total_count = decoded.get_total_count()
+ for item in decoded.get_recorded_iterator():
+ xaxis.append(item.value_iterated_to)
+ prob = float(item.count_added_in_this_iter_step) / \
+ total_count * 100
+ yaxis.append(prob)
+ hovertext.append(
+ f"Test: {name}<br>"
+ f"Direction: {directions[idx_col]}<br>"
+ f"Latency: {item.value_iterated_to}uSec<br>"
+ f"Probability: {prob:.2f}%<br>"
+ f"Percentile: "
+ f"{item.percentile_level_iterated_to:.2f}"
+ )
+ marker_color = [COLORS[idx_row], ] * len(yaxis)
+ marker_color[xaxis.index(
+ decoded.get_value_at_percentile(50.0))] = u"red"
+ marker_color[xaxis.index(
+ decoded.get_value_at_percentile(90.0))] = u"red"
+ marker_color[xaxis.index(
+ decoded.get_value_at_percentile(95.0))] = u"red"
+ histograms.append(
+ plgo.Bar(
+ x=xaxis,
+ y=yaxis,
+ showlegend=False,
+ name=name,
+ marker={u"color": marker_color},
+ hovertext=hovertext,
+ hoverinfo=u"text"
+ )
+ )
+ except hdrh.codec.HdrLengthException as err:
+ logging.warning(
+ f"No or invalid data for HDRHistogram for the test "
+ f"{name}\n{err}"
+ )