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.
34 LOG_LEVEL = logging.INFO
35 LOG_FORMAT = "%(asctime)s: %(levelname)s: %(message)s"
36 LOG_DATE_FORMAT = "%Y/%m/%d %H:%M:%S"
38 # The application title.
41 # The application description.
42 DESCRIPTION = "Performance Dashboard"
44 # External stylesheets.
45 EXTERNAL_STYLESHEETS = [dbc.themes.LUX, ]
47 # Top level template for all pages.
48 TEMPLATE = "d-flex h-100 text-center text-white bg-dark"
50 # Path and name of the file specifying the HTML layout of the dash
52 MAIN_HTML_LAYOUT_FILE = "index_layout.jinja2"
57 # Data to be downloaded from the parquets specification file.
58 DATA_SPEC_FILE = "pal/data/data.yaml"
60 # The file with tooltips.
61 TOOLTIP_FILE = "pal/utils/tooltips.yaml"
63 # Maximal value of TIME_PERIOD for data read from the parquets in days.
64 # Do not change without a good reason.
67 # It defines the time period for data read from the parquets in days from
68 # now back to the past.
69 # TIME_PERIOD = None - means all data (max MAX_TIME_PERIOD days) is read.
70 # TIME_PERIOD = MAX_TIME_PERIOD - is the default value
71 TIME_PERIOD = MAX_TIME_PERIOD # [days]
73 # List of releases used for iterative data processing.
74 # The releases MUST be in the order from the current (newest) to the last
76 RELEASES = ["csit2206", "csit2202", ]
78 ############################################################################
79 # General, application wide, layout affecting constants.
81 # If True, clear all inputs in control panel when button "ADD SELECTED" is
83 CLEAR_ALL_INPUTS = False
85 # The element is disabled.
86 STYLE_DISABLED = {"display": "none"}
88 # The element is enabled and visible.
89 STYLE_ENABLED = {"display": "inherit"}
91 # Checklist "All" is disabled.
100 # Checklist "All" is enable, visible and unchecked.
109 # Placeholder for any element in the layout.
110 PLACEHOLDER = html.Nobr("")
112 # List of drivers used in CSIT.
113 DRIVERS = ("avf", "af-xdp", "rdma", "dpdk")
115 # Labels for input elements (dropdowns, ...).
118 "container_memif": "LXC/DRC Container Memif",
119 "crypto": "IPSec IPv4 Routing",
120 "ip4": "IPv4 Routing",
121 "ip6": "IPv6 Routing",
122 "ip4_tunnels": "IPv4 Tunnels",
123 "l2": "L2 Ethernet Switching",
124 "srv6": "SRv6 Routing",
125 "vm_vhost": "VMs vhost-user",
126 "nfv_density-dcr_memif-chain_ipsec": "CNF Service Chains Routing IPSec",
127 "nfv_density-vm_vhost-chain_dot1qip4vxlan":"VNF Service Chains Tunnels",
128 "nfv_density-vm_vhost-chain": "VNF Service Chains Routing",
129 "nfv_density-dcr_memif-pipeline": "CNF Service Pipelines Routing",
130 "nfv_density-dcr_memif-chain": "CNF Service Chains Routing",
135 "background-color": "#d2ebf5",
136 "border-color": "#bce1f1",
140 ############################################################################
141 # General, normalization constants.
143 NORM_FREQUENCY = 2.0 # [GHz]
144 FREQUENCY = { # [GHz]
160 ############################################################################
161 # General, plots constants.
164 "#1A1110", "#DA2647", "#214FC6", "#01786F", "#BD8260", "#FFD12A",
165 "#A6E7FF", "#738276", "#C95A49", "#FC5A8D", "#CEC8EF", "#391285",
166 "#6F2DA8", "#FF878D", "#45A27D", "#FFD0B9", "#FD5240", "#DB91EF",
167 "#44D7A8", "#4F86F7", "#84DE02", "#FFCFF1", "#614051"
170 # Trending, anomalies.
186 TICK_TEXT_TPUT = ["Regression", "Normal", "Progression"]
197 TICK_TEXT_LAT = ["Progression", "Normal", "Regression"]
199 # Access to the results.
201 "mrr": "result_receive_rate_rate_avg",
202 "ndr": "result_ndr_lower_rate_value",
203 "pdr": "result_pdr_lower_rate_value",
204 "pdr-lat": "result_latency_forward_pdr_50_avg"
208 "mrr": "result_receive_rate_rate_values",
209 "ndr": "result_ndr_lower_rate_value",
210 "pdr": "result_pdr_lower_rate_value",
211 "pdr-lat": "result_latency_forward_pdr_50_avg"
215 "mrr": "result_receive_rate_rate_unit",
216 "ndr": "result_ndr_lower_rate_unit",
217 "pdr": "result_pdr_lower_rate_unit",
218 "pdr-lat": "result_latency_forward_pdr_50_unit"
222 LAT_HDRH = ( # Do not change the order
223 "result_latency_forward_pdr_0_hdrh",
224 "result_latency_reverse_pdr_0_hdrh",
225 "result_latency_forward_pdr_10_hdrh",
226 "result_latency_reverse_pdr_10_hdrh",
227 "result_latency_forward_pdr_50_hdrh",
228 "result_latency_reverse_pdr_50_hdrh",
229 "result_latency_forward_pdr_90_hdrh",
230 "result_latency_reverse_pdr_90_hdrh",
233 # This value depends on latency stream rate (9001 pps) and duration (5s).
234 # Keep it slightly higher to ensure rounding errors to not remove tick mark.
235 PERCENTILE_MAX = 99.999501
237 GRAPH_LAT_HDRH_DESC = {
238 "result_latency_forward_pdr_0_hdrh": "No-load.",
239 "result_latency_reverse_pdr_0_hdrh": "No-load.",
240 "result_latency_forward_pdr_10_hdrh": "Low-load, 10% PDR.",
241 "result_latency_reverse_pdr_10_hdrh": "Low-load, 10% PDR.",
242 "result_latency_forward_pdr_50_hdrh": "Mid-load, 50% PDR.",
243 "result_latency_reverse_pdr_50_hdrh": "Mid-load, 50% PDR.",
244 "result_latency_forward_pdr_90_hdrh": "High-load, 90% PDR.",
245 "result_latency_reverse_pdr_90_hdrh": "High-load, 90% PDR."
248 ############################################################################
251 # The pathname prefix for the application.
252 NEWS_ROUTES_PATHNAME_PREFIX = "/news/"
254 # Path and name of the file specifying the HTML layout of the dash
256 NEWS_HTML_LAYOUT_FILE = "pal/templates/news_layout.jinja2"
258 # The default job displayed when the page is loaded first time.
259 NEWS_DEFAULT_JOB = "csit-vpp-perf-mrr-daily-master-2n-icx"
261 # Time period for regressions and progressions.
262 NEWS_TIME_PERIOD = TIME_PERIOD # [days]
264 # Time period for summary tables.
265 NEWS_SUMMARY_PERIOD = 7 # [days]
267 ############################################################################
270 # The pathname prefix for the application.
271 REPORT_ROUTES_PATHNAME_PREFIX = "/report/"
273 # Path and name of the file specifying the HTML layout of the dash
275 REPORT_HTML_LAYOUT_FILE = "pal/templates/report_layout.jinja2"
277 # Layout of plot.ly graphs.
278 REPORT_GRAPH_LAYOUT_FILE = "pal/report/layout.yaml"
280 # Default name of downloaded file with selected data.
281 REPORT_DOWNLOAD_FILE_NAME = "iterative_data.csv"
283 ############################################################################
286 # The pathname prefix for the application.
287 STATS_ROUTES_PATHNAME_PREFIX = "/stats/"
289 # Path and name of the file specifying the HTML layout of the dash
291 STATS_HTML_LAYOUT_FILE = "pal/templates/stats_layout.jinja2"
293 # Layout of plot.ly graphs.
294 STATS_GRAPH_LAYOUT_FILE = "pal/stats/layout.yaml"
296 # The default job displayed when the page is loaded first time.
297 STATS_DEFAULT_JOB = "csit-vpp-perf-mrr-daily-master-2n-icx"
299 # Default name of downloaded file with selected data.
300 STATS_DOWNLOAD_FILE_NAME = "stats.csv"
302 ############################################################################
305 # The pathname prefix for the application.
306 TREND_ROUTES_PATHNAME_PREFIX = "/trending/"
308 # Path and name of the file specifying the HTML layout of the dash
310 TREND_HTML_LAYOUT_FILE = "pal/templates/trending_layout.jinja2"
312 # Layout of plot.ly graphs.
313 TREND_GRAPH_LAYOUT_FILE = "pal/trending/layout.yaml"
315 # Default name of downloaded file with selected data.
316 TREND_DOWNLOAD_FILE_NAME = "trending_data.csv"