Previously, they used sloped lines connecting reported points.
But HdrHistogram reports only the upper bound of percentile.
Example: If all samples are 10us,
HdrHistogram reports a single value at 100%.
This change attempts to show the whole intervals (0%-100% for the example)
as a series (vertically connected) of horizontal lines.
Hover also shows percentiles as intervals.
Change-Id: Id7bbff7b1c29d7f62472041340fde88903363cfa
Signed-off-by: Vratko Polak <vrpolak@cisco.com>
(cherry picked from commit
826d80373dbd20bc1feac2403e9cade9e5633336)
-# Copyright (c) 2020 Cisco and/or its affiliates.
+# Copyright (c) 2021 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:
# 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:
for color, graph in enumerate(graphs):
for idx, direction in enumerate((u"direction1", u"direction2")):
for color, graph in enumerate(graphs):
for idx, direction in enumerate((u"direction1", u"direction2")):
xaxis = list()
yaxis = list()
hovertext = list()
xaxis = list()
yaxis = list()
hovertext = list()
percentile = item.percentile_level_iterated_to
if percentile > 99.9999999:
continue
percentile = item.percentile_level_iterated_to
if percentile > 99.9999999:
continue
+ xaxis.append(previous_x)
+ yaxis.append(item.value_iterated_to)
+ hovertext.append(
+ f"<b>{desc[graph]}</b><br>"
+ f"Direction: {(u'W-E', u'E-W')[idx % 2]}<br>"
+ f"Percentile: {previous_x:.5f}-{percentile:.5f}%<br>"
+ f"Latency: {item.value_iterated_to}uSec"
+ )
xaxis.append(percentile)
yaxis.append(item.value_iterated_to)
hovertext.append(
f"<b>{desc[graph]}</b><br>"
f"Direction: {(u'W-E', u'E-W')[idx % 2]}<br>"
xaxis.append(percentile)
yaxis.append(item.value_iterated_to)
hovertext.append(
f"<b>{desc[graph]}</b><br>"
f"Direction: {(u'W-E', u'E-W')[idx % 2]}<br>"
- f"Percentile: {percentile:.5f}%<br>"
+ f"Percentile: {previous_x:.5f}-{percentile:.5f}%<br>"
f"Latency: {item.value_iterated_to}uSec"
)
f"Latency: {item.value_iterated_to}uSec"
)
+ previous_x = percentile
fig.add_trace(
plgo.Scatter(
x=xaxis,
fig.add_trace(
plgo.Scatter(
x=xaxis,
showlegend=bool(idx),
line=dict(
color=COLORS[color],
showlegend=bool(idx),
line=dict(
color=COLORS[color],
- dash=u"dash" if idx % 2 else u"solid"
+ dash=u"solid",
+ width=1 if idx % 2 else 2
),
hovertext=hovertext,
hoverinfo=u"text"
),
hovertext=hovertext,
hoverinfo=u"text"
for color, graph in enumerate(graphs):
for idx, direction in enumerate((u"direction1", u"direction2")):
for color, graph in enumerate(graphs):
for idx, direction in enumerate((u"direction1", u"direction2")):
+ previous_x = 0.0
+ prev_perc = 0.0
xaxis = list()
yaxis = list()
hovertext = list()
xaxis = list()
yaxis = list()
hovertext = list()
percentile = item.percentile_level_iterated_to
if percentile > 99.9999999:
continue
percentile = item.percentile_level_iterated_to
if percentile > 99.9999999:
continue
- xaxis.append(100.0 / (100.0 - percentile))
+ xaxis.append(previous_x)
+ yaxis.append(item.value_iterated_to)
+ hovertext.append(
+ f"<b>{desc[graph]}</b><br>"
+ f"Direction: {(u'W-E', u'E-W')[idx % 2]}<br>"
+ f"Percentile: {prev_perc:.5f}-{percentile:.5f}%<br>"
+ f"Latency: {item.value_iterated_to}uSec"
+ )
+ next_x = 100.0 / (100.0 - percentile)
+ xaxis.append(next_x)
yaxis.append(item.value_iterated_to)
hovertext.append(
f"<b>{desc[graph]}</b><br>"
f"Direction: {(u'W-E', u'E-W')[idx % 2]}<br>"
yaxis.append(item.value_iterated_to)
hovertext.append(
f"<b>{desc[graph]}</b><br>"
f"Direction: {(u'W-E', u'E-W')[idx % 2]}<br>"
- f"Percentile: {percentile:.5f}%<br>"
+ f"Percentile: {prev_perc:.5f}-{percentile:.5f}%<br>"
f"Latency: {item.value_iterated_to}uSec"
)
f"Latency: {item.value_iterated_to}uSec"
)
+ previous_x = next_x
+ prev_perc = percentile
fig.add_trace(
plgo.Scatter(
x=xaxis,
fig.add_trace(
plgo.Scatter(
x=xaxis,
showlegend=not(bool(idx)),
line=dict(
color=COLORS[color],
showlegend=not(bool(idx)),
line=dict(
color=COLORS[color],
- dash=u"dash" if idx % 2 else u"solid"
+ dash=u"solid",
+ width=1 if idx % 2 else 2
),
hovertext=hovertext,
hoverinfo=u"text"
),
hovertext=hovertext,
hoverinfo=u"text"