aboutsummaryrefslogtreecommitdiffstats
path: root/resources/tools
diff options
context:
space:
mode:
authorVratko Polak <vrpolak@cisco.com>2021-01-21 12:44:11 +0100
committerTibor Frank <tifrank@cisco.com>2021-01-25 06:30:52 +0000
commitd4f12e6931c7fdf84043d8fb2f71e2f38965f26b (patch)
treef9e269a33eae2313fa426e818180256aff0b81dd /resources/tools
parent67d3b2a44d49dd2c4a1b2f722849f57432787137 (diff)
Hdrh latency graphs: Do not skip the last value
Linear x axis does not need any skipping. For logarithmic axis, descrease from 100% to avoid infinity. Currently using a fixed PERCENTILE_MAX value. Added a comment on when to change that value. Change-Id: Ic10a19532455e597272efdb4542e43d09ce49d5c Signed-off-by: Vratko Polak <vrpolak@cisco.com>
Diffstat (limited to 'resources/tools')
-rw-r--r--resources/tools/presentation/generator_plots.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/resources/tools/presentation/generator_plots.py b/resources/tools/presentation/generator_plots.py
index dd00939415..db130fa9b7 100644
--- a/resources/tools/presentation/generator_plots.py
+++ b/resources/tools/presentation/generator_plots.py
@@ -61,6 +61,9 @@ COLORS = (
REGEX_NIC = re.compile(r'(\d*ge\dp\d\D*\d*[a-z]*)-')
+# This value depends on latency stream rate (9001 pps) and duration (5s).
+PERCENTILE_MAX = 99.9995
+
def generate_plots(spec, data):
"""Generate all plots specified in the specification file.
@@ -189,8 +192,6 @@ def plot_hdrh_lat_by_percentile(plot, input_data):
for item in decoded.get_recorded_iterator():
percentile = item.percentile_level_iterated_to
- if percentile > 99.9999999:
- continue
xaxis.append(previous_x)
yaxis.append(item.value_iterated_to)
hovertext.append(
@@ -355,9 +356,10 @@ def plot_hdrh_lat_by_percentile_x_log(plot, input_data):
continue
for item in decoded.get_recorded_iterator():
+ # The real value is "percentile".
+ # For 100%, we cut that down to "x_perc" to avoid infinity.
percentile = item.percentile_level_iterated_to
- if percentile > 99.9999999:
- continue
+ x_perc = min(percentile, PERCENTILE_MAX)
xaxis.append(previous_x)
yaxis.append(item.value_iterated_to)
hovertext.append(
@@ -366,7 +368,7 @@ def plot_hdrh_lat_by_percentile_x_log(plot, input_data):
f"Percentile: {prev_perc:.5f}-{percentile:.5f}%<br>"
f"Latency: {item.value_iterated_to}uSec"
)
- next_x = 100.0 / (100.0 - percentile)
+ next_x = 100.0 / (100.0 - x_perc)
xaxis.append(next_x)
yaxis.append(item.value_iterated_to)
hovertext.append(