diff options
author | Vratko Polak <vrpolak@cisco.com> | 2021-02-08 11:31:57 +0100 |
---|---|---|
committer | Tibor Frank <tifrank@cisco.com> | 2021-02-08 11:04:59 +0000 |
commit | 23925af47ecdbe032d72018998385d32b252a66a (patch) | |
tree | da37a0570b9235ff552e9fadac91b3cc01fa6038 /resources | |
parent | 5fde7a2bb154161137c5a29881a36c698a969a8b (diff) |
Latency graphs: Do not hardcode x range
+ Compute it from PERCENTILE_MAX.
+ Use slightly higher PERCENTILE_MAX to avoid rounding errors.
+ Add a comment why slightly higher value is needed.
Change-Id: Ic54378d94568efbb8c78a889424f931591ef42db
Signed-off-by: Vratko Polak <vrpolak@cisco.com>
(cherry picked from commit 7c0d519483e2c5e5a0c9997ed01408200b64370b)
Diffstat (limited to 'resources')
-rw-r--r-- | resources/tools/presentation/generator_plots.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/resources/tools/presentation/generator_plots.py b/resources/tools/presentation/generator_plots.py index 7298babe53..4ceeebc7d1 100644 --- a/resources/tools/presentation/generator_plots.py +++ b/resources/tools/presentation/generator_plots.py @@ -62,7 +62,8 @@ 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 +# Keep it slightly higher to ensure rounding errors to not remove tick mark. +PERCENTILE_MAX = 99.999501 def generate_plots(spec, data): @@ -398,7 +399,8 @@ def plot_hdrh_lat_by_percentile_x_log(plot, input_data): ) layout[u"title"][u"text"] = f"<b>Latency:</b> {name}" - layout[u"xaxis"][u"range"] = [0, 5.302] + x_max = log(100.0 / (100.0 - PERCENTILE_MAX), 10) + layout[u"xaxis"][u"range"] = [0, x_max] fig.update_layout(layout) # Create plot |