-from numpy import isnan
-
-from ..jumpavg import classify
-
-
-_NORM_FREQUENCY = 2.0 # [GHz]
-_FREQURENCY = { # [GHz]
- "2n-aws": 1.000,
- "2n-dnv": 2.000,
- "2n-clx": 2.300,
- "2n-icx": 2.600,
- "2n-skx": 2.500,
- "2n-tx2": 2.500,
- "2n-zn2": 2.900,
- "3n-alt": 3.000,
- "3n-aws": 1.000,
- "3n-dnv": 2.000,
- "3n-icx": 2.600,
- "3n-skx": 2.500,
- "3n-tsh": 2.200
-}
-
-_ANOMALY_COLOR = {
- "regression": 0.0,
- "normal": 0.5,
- "progression": 1.0
-}
-_COLORSCALE_TPUT = [
- [0.00, "red"],
- [0.33, "red"],
- [0.33, "white"],
- [0.66, "white"],
- [0.66, "green"],
- [1.00, "green"]
-]
-_TICK_TEXT_TPUT = ["Regression", "Normal", "Progression"]
-_COLORSCALE_LAT = [
- [0.00, "green"],
- [0.33, "green"],
- [0.33, "white"],
- [0.66, "white"],
- [0.66, "red"],
- [1.00, "red"]
-]
-_TICK_TEXT_LAT = ["Progression", "Normal", "Regression"]
-_VALUE = {
- "mrr": "result_receive_rate_rate_avg",
- "ndr": "result_ndr_lower_rate_value",
- "pdr": "result_pdr_lower_rate_value",
- "pdr-lat": "result_latency_forward_pdr_50_avg"
-}
-_UNIT = {
- "mrr": "result_receive_rate_rate_unit",
- "ndr": "result_ndr_lower_rate_unit",
- "pdr": "result_pdr_lower_rate_unit",
- "pdr-lat": "result_latency_forward_pdr_50_unit"
-}
-_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)]