1 # Copyright (c) 2022 Cisco and/or its affiliates.
2 # Licensed under the Apache License, Version 2.0 (the "License");
3 # you may not use this file except in compliance with the License.
4 # You may obtain a copy of the License at:
6 # http://www.apache.org/licenses/LICENSE-2.0
8 # Unless required by applicable law or agreed to in writing, software
9 # distributed under the License is distributed on an "AS IS" BASIS,
10 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 # See the License for the specific language governing permissions and
12 # limitations under the License.
14 """Constants used in Dash PAL.
16 "Constant" means a value that keeps its value since initialization. The value
17 does not need to be hard coded here, but can be read from environment variables.
21 import dash_bootstrap_components as dbc
27 """Constants used in Dash PAL.
30 ############################################################################
31 # General, application wide constants.
33 # The application title.
36 # The application description.
37 DESCRIPTION = "Performance Dashboard"
39 # External stylesheets.
40 EXTERNAL_STYLESHEETS = [dbc.themes.LUX, ]
42 # Top level template for all pages.
43 TEMPLATE = "d-flex h-100 text-center text-white bg-dark"
45 # Path and name of the file specifying the HTML layout of the dash
47 MAIN_HTML_LAYOUT_FILE = "index_layout.jinja2"
52 # Data to be downloaded from the parquets specification file.
53 DATA_SPEC_FILE = "pal/data/data.yaml"
55 # The file with tooltips.
56 TOOLTIP_FILE = "pal/utils/tooltips.yaml"
58 # Maximal value of TIME_PERIOD for data read from the parquets in days.
59 # Do not change without a good reason.
62 # It defines the time period for data read from the parquets in days from
63 # now back to the past.
64 # TIME_PERIOD = None - means all data (max MAX_TIME_PERIOD days) is read.
65 # TIME_PERIOD = MAX_TIME_PERIOD - is the default value
66 TIME_PERIOD = MAX_TIME_PERIOD # [days]
68 # List of releases used for iterative data processing.
69 # The releases MUST be in the order from the current (newest) to the last
71 RELEASES = ["csit2206", "csit2202", ]
73 ############################################################################
74 # General, application wide, layout affecting constants.
76 # If True, clear all inputs in control panel when button "ADD SELECTED" is
78 CLEAR_ALL_INPUTS = False
80 # The element is disabled.
81 STYLE_DISABLED = {"display": "none"}
83 # The element is enabled and visible.
84 STYLE_ENABLED = {"display": "inherit"}
86 # Checklist "All" is disabled.
95 # Checklist "All" is enable, visible and unchecked.
104 # Placeholder for any element in the layout.
105 PLACEHOLDER = html.Nobr("")
107 # List of drivers used in CSIT.
108 DRIVERS = ("avf", "af-xdp", "rdma", "dpdk")
110 # Labels for input elements (dropdowns, ...).
113 "container_memif": "LXC/DRC Container Memif",
114 "crypto": "IPSec IPv4 Routing",
115 "ip4": "IPv4 Routing",
116 "ip6": "IPv6 Routing",
117 "ip4_tunnels": "IPv4 Tunnels",
118 "l2": "L2 Ethernet Switching",
119 "srv6": "SRv6 Routing",
120 "vm_vhost": "VMs vhost-user",
121 "nfv_density-dcr_memif-chain_ipsec": "CNF Service Chains Routing IPSec",
122 "nfv_density-vm_vhost-chain_dot1qip4vxlan":"VNF Service Chains Tunnels",
123 "nfv_density-vm_vhost-chain": "VNF Service Chains Routing",
124 "nfv_density-dcr_memif-pipeline": "CNF Service Pipelines Routing",
125 "nfv_density-dcr_memif-chain": "CNF Service Chains Routing",
130 "background-color": "#d2ebf5",
131 "border-color": "#bce1f1",
135 ############################################################################
136 # General, normalization constants.
138 NORM_FREQUENCY = 2.0 # [GHz]
139 FREQUENCY = { # [GHz]
155 ############################################################################
156 # General, plots constants.
159 "#1A1110", "#DA2647", "#214FC6", "#01786F", "#BD8260", "#FFD12A",
160 "#A6E7FF", "#738276", "#C95A49", "#FC5A8D", "#CEC8EF", "#391285",
161 "#6F2DA8", "#FF878D", "#45A27D", "#FFD0B9", "#FD5240", "#DB91EF",
162 "#44D7A8", "#4F86F7", "#84DE02", "#FFCFF1", "#614051"
165 # Trending, anomalies.
181 TICK_TEXT_TPUT = ["Regression", "Normal", "Progression"]
192 TICK_TEXT_LAT = ["Progression", "Normal", "Regression"]
194 # Access to the results.
196 "mrr": "result_receive_rate_rate_avg",
197 "ndr": "result_ndr_lower_rate_value",
198 "pdr": "result_pdr_lower_rate_value",
199 "pdr-lat": "result_latency_forward_pdr_50_avg"
203 "mrr": "result_receive_rate_rate_values",
204 "ndr": "result_ndr_lower_rate_value",
205 "pdr": "result_pdr_lower_rate_value",
206 "pdr-lat": "result_latency_forward_pdr_50_avg"
210 "mrr": "result_receive_rate_rate_unit",
211 "ndr": "result_ndr_lower_rate_unit",
212 "pdr": "result_pdr_lower_rate_unit",
213 "pdr-lat": "result_latency_forward_pdr_50_unit"
217 LAT_HDRH = ( # Do not change the order
218 "result_latency_forward_pdr_0_hdrh",
219 "result_latency_reverse_pdr_0_hdrh",
220 "result_latency_forward_pdr_10_hdrh",
221 "result_latency_reverse_pdr_10_hdrh",
222 "result_latency_forward_pdr_50_hdrh",
223 "result_latency_reverse_pdr_50_hdrh",
224 "result_latency_forward_pdr_90_hdrh",
225 "result_latency_reverse_pdr_90_hdrh",
228 # This value depends on latency stream rate (9001 pps) and duration (5s).
229 # Keep it slightly higher to ensure rounding errors to not remove tick mark.
230 PERCENTILE_MAX = 99.999501
232 GRAPH_LAT_HDRH_DESC = {
233 "result_latency_forward_pdr_0_hdrh": "No-load.",
234 "result_latency_reverse_pdr_0_hdrh": "No-load.",
235 "result_latency_forward_pdr_10_hdrh": "Low-load, 10% PDR.",
236 "result_latency_reverse_pdr_10_hdrh": "Low-load, 10% PDR.",
237 "result_latency_forward_pdr_50_hdrh": "Mid-load, 50% PDR.",
238 "result_latency_reverse_pdr_50_hdrh": "Mid-load, 50% PDR.",
239 "result_latency_forward_pdr_90_hdrh": "High-load, 90% PDR.",
240 "result_latency_reverse_pdr_90_hdrh": "High-load, 90% PDR."
243 ############################################################################
246 # The pathname prefix for the application.
247 NEWS_ROUTES_PATHNAME_PREFIX = "/news/"
249 # Path and name of the file specifying the HTML layout of the dash
251 NEWS_HTML_LAYOUT_FILE = "pal/templates/news_layout.jinja2"
253 # The default job displayed when the page is loaded first time.
254 NEWS_DEFAULT_JOB = "csit-vpp-perf-mrr-daily-master-2n-icx"
256 # Time period for regressions and progressions.
257 NEWS_TIME_PERIOD = 21 # [days]
259 ############################################################################
262 # The pathname prefix for the application.
263 REPORT_ROUTES_PATHNAME_PREFIX = "/report/"
265 # Path and name of the file specifying the HTML layout of the dash
267 REPORT_HTML_LAYOUT_FILE = "pal/templates/report_layout.jinja2"
269 # Layout of plot.ly graphs.
270 REPORT_GRAPH_LAYOUT_FILE = "pal/report/layout.yaml"
272 ############################################################################
275 # The pathname prefix for the application.
276 STATS_ROUTES_PATHNAME_PREFIX = "/stats/"
278 # Path and name of the file specifying the HTML layout of the dash
280 STATS_HTML_LAYOUT_FILE = "pal/templates/stats_layout.jinja2"
282 # Layout of plot.ly graphs.
283 STATS_GRAPH_LAYOUT_FILE = "pal/stats/layout.yaml"
285 # The default job displayed when the page is loaded first time.
286 STATS_DEFAULT_JOB = "csit-vpp-perf-mrr-daily-master-2n-icx"
288 ############################################################################
291 # The pathname prefix for the application.
292 TREND_ROUTES_PATHNAME_PREFIX = "/trending/"
294 # Path and name of the file specifying the HTML layout of the dash
296 TREND_HTML_LAYOUT_FILE = "pal/templates/trending_layout.jinja2"
298 # Layout of plot.ly graphs.
299 TREND_GRAPH_LAYOUT_FILE = "pal/trending/layout.yaml"