+_LAT_HDRH = ( # Do not change the order
+ "result_latency_forward_pdr_0_hdrh",
+ "result_latency_reverse_pdr_0_hdrh",
+ "result_latency_forward_pdr_10_hdrh",
+ "result_latency_reverse_pdr_10_hdrh",
+ "result_latency_forward_pdr_50_hdrh",
+ "result_latency_reverse_pdr_50_hdrh",
+ "result_latency_forward_pdr_90_hdrh",
+ "result_latency_reverse_pdr_90_hdrh",
+)
+# This value depends on latency stream rate (9001 pps) and duration (5s).
+# Keep it slightly higher to ensure rounding errors to not remove tick mark.
+PERCENTILE_MAX = 99.999501
+
+_GRAPH_LAT_HDRH_DESC = {
+ "result_latency_forward_pdr_0_hdrh": "No-load.",
+ "result_latency_reverse_pdr_0_hdrh": "No-load.",
+ "result_latency_forward_pdr_10_hdrh": "Low-load, 10% PDR.",
+ "result_latency_reverse_pdr_10_hdrh": "Low-load, 10% PDR.",
+ "result_latency_forward_pdr_50_hdrh": "Mid-load, 50% PDR.",
+ "result_latency_reverse_pdr_50_hdrh": "Mid-load, 50% PDR.",
+ "result_latency_forward_pdr_90_hdrh": "High-load, 90% PDR.",
+ "result_latency_reverse_pdr_90_hdrh": "High-load, 90% PDR."
+}
+
+
+def _get_color(idx: int) -> str:
+ """
+ """
+ _COLORS = (
+ "#1A1110", "#DA2647", "#214FC6", "#01786F", "#BD8260", "#FFD12A",
+ "#A6E7FF", "#738276", "#C95A49", "#FC5A8D", "#CEC8EF", "#391285",
+ "#6F2DA8", "#FF878D", "#45A27D", "#FFD0B9", "#FD5240", "#DB91EF",
+ "#44D7A8", "#4F86F7", "#84DE02", "#FFCFF1", "#614051"
+ )
+ return _COLORS[idx % len(_COLORS)]
+
+
+def _get_hdrh_latencies(row: pd.Series, name: str) -> dict:
+ """
+ """
+
+ latencies = {"name": name}
+ for key in _LAT_HDRH:
+ try:
+ latencies[key] = row[key]
+ except KeyError:
+ return None
+
+ return latencies