1 # Copyright (c) 2023 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 CDash.
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.
26 """Constants used in CDash.
29 ############################################################################
30 # General, application wide constants.
33 LOG_LEVEL = logging.INFO
34 LOG_FORMAT = "%(asctime)s: %(levelname)s: %(message)s"
35 LOG_DATE_FORMAT = "%Y/%m/%d %H:%M:%S"
37 # The application title.
41 # The application description.
42 DESCRIPTION = "Performance Dashboard"
44 # External stylesheets.
45 EXTERNAL_STYLESHEETS = ["/static/dist/css/bootstrap.css", ]
47 # Path and name of the file specifying the HTML layout of the dash
49 MAIN_HTML_LAYOUT_FILE = "base_layout.jinja2"
51 # Path and name of the file specifying the HTML layout of the dash
53 HTML_LAYOUT_FILE = "cdash/templates/dash_layout.jinja2"
58 # Data to be downloaded from the parquets specification file.
59 DATA_SPEC_FILE = "cdash/data/data.yaml"
61 # The file with tooltips.
62 TOOLTIP_FILE = "cdash/utils/tooltips.yaml"
64 # Maximal value of TIME_PERIOD for data read from the parquets in days.
65 # Do not change without a good reason.
68 # It defines the time period for data read from the parquets in days from
69 # now back to the past.
70 # TIME_PERIOD = None - means all data (max MAX_TIME_PERIOD days) is read.
71 # TIME_PERIOD = MAX_TIME_PERIOD - is the default value
72 TIME_PERIOD = MAX_TIME_PERIOD # [days]
74 ############################################################################
75 # General, application wide, layout affecting constants.
77 # Add a time delay (in ms) to the spinner being shown
80 # If True, clear all inputs in control panel when button "ADD SELECTED" is
82 CLEAR_ALL_INPUTS = False
84 # The element is disabled.
85 STYLE_DISABLED = {"display": "none"}
87 # The element is enabled and visible.
88 STYLE_ENABLED = {"display": "inherit"}
90 # Checklist "All" is disabled.
99 # Checklist "All" is enabled, visible and unchecked.
108 # Placeholder for any element in the layout.
109 PLACEHOLDER = html.Nobr("")
111 # List of drivers used in CSIT.
112 DRIVERS = ("avf", "af-xdp", "rdma", "dpdk", "mlx5")
114 # Labels for input elements (dropdowns, ...).
117 "container_memif": "LXC/DRC Container Memif",
118 "crypto": "IPSec IPv4 Routing",
119 "ip4": "IPv4 Routing",
120 "ip4_tunnels": "IPv4 Tunnels",
121 "ip6": "IPv6 Routing",
122 "ip6_tunnels": "IPv6 Tunnels",
123 "l2": "L2 Ethernet Switching",
124 "lb": "Load Balancer",
125 "srv6": "SRv6 Routing",
126 "vm_vhost": "VMs vhost-user",
127 "nfv_density.dcr_memif.chain_ipsec": "CNF Service Chains Routing IPSec",
128 "nfv_density.vm_vhost.chain_dot1qip4vxlan":"VNF Service Chains Tunnels",
129 "nfv_density.vm_vhost.chain": "VNF Service Chains Routing",
130 "nfv_density.dcr_memif.pipeline": "CNF Service Pipelines Routing",
131 "nfv_density.dcr_memif.chain": "CNF Service Chains Routing",
132 "hoststack": "Hoststack",
134 "l2bd": "L2 Bridge Domain",
135 "crypto.ethip4": "IPSec IPv4 Routing",
136 "crypto.ethip6": "IPSec IPv6 Routing",
137 "interfaces": "Interfaces",
138 "ip4_tunnels.lisp": "IPv4 Tunnels LISP",
139 "ip6_tunnels.lisp": "IPv6 Tunnels LISP",
140 "l2patch": "L2 Patch",
141 "l2xc": "L2 Cross Connect",
142 "vm_vhost.ethip4": "VMs vhost-user IPv4 Routing",
143 "vm_vhost.ethip6": "VMs vhost-user IPv6 Routing"
148 "background-color": "#d2ebf5",
149 "border-color": "#bce1f1",
153 ############################################################################
154 # General, normalization constants.
156 NORM_FREQUENCY = 2.0 # [GHz]
157 FREQUENCY = { # [GHz]
176 ############################################################################
177 # General, plots and tables constants.
180 "#1A1110", "#DA2647", "#214FC6", "#01786F", "#BD8260", "#FFD12A",
181 "#A6E7FF", "#738276", "#C95A49", "#FC5A8D", "#CEC8EF", "#391285",
182 "#6F2DA8", "#FF878D", "#45A27D", "#FFD0B9", "#FD5240", "#DB91EF",
183 "#44D7A8", "#4F86F7", "#84DE02", "#FFCFF1", "#614051"
186 # Trending, anomalies.
202 TICK_TEXT_TPUT = ["Regression", "Normal", "Progression"]
213 TICK_TEXT_LAT = ["Progression", "Normal", "Regression"]
215 # Access to the results.
217 "mrr": "result_receive_rate_rate_avg",
218 "ndr": "result_ndr_lower_rate_value",
219 "pdr": "result_pdr_lower_rate_value",
220 "latency": "result_latency_forward_pdr_50_avg",
221 "hoststack-cps": "result_rate_value",
222 "hoststack-rps": "result_rate_value",
223 "hoststack-bps": "result_bandwidth_value",
224 "hoststack-latency": "result_latency_value"
228 "mrr": "result_receive_rate_rate_values",
229 "ndr": "result_ndr_lower_rate_value",
230 "pdr": "result_pdr_lower_rate_value",
231 "latency": "result_latency_forward_pdr_50_avg",
232 "hoststack-cps": "result_rate_value",
233 "hoststack-rps": "result_rate_value",
234 "hoststack-bps": "result_bandwidth_value",
235 "hoststack-latency": "result_latency_value"
239 "mrr": "result_receive_rate_rate_unit",
240 "ndr": "result_ndr_lower_rate_unit",
241 "pdr": "result_pdr_lower_rate_unit",
242 "latency": "result_latency_forward_pdr_50_unit",
243 "hoststack-cps": "result_rate_unit",
244 "hoststack-rps": "result_rate_unit",
245 "hoststack-bps": "result_bandwidth_unit",
246 "hoststack-latency": "result_latency_unit"
250 LAT_HDRH = ( # Do not change the order
251 "result_latency_forward_pdr_0_hdrh",
252 "result_latency_reverse_pdr_0_hdrh",
253 "result_latency_forward_pdr_10_hdrh",
254 "result_latency_reverse_pdr_10_hdrh",
255 "result_latency_forward_pdr_50_hdrh",
256 "result_latency_reverse_pdr_50_hdrh",
257 "result_latency_forward_pdr_90_hdrh",
258 "result_latency_reverse_pdr_90_hdrh",
261 # This value depends on latency stream rate (9001 pps) and duration (5s).
262 # Keep it slightly higher to ensure rounding errors to not remove tick mark.
263 PERCENTILE_MAX = 99.999501
265 GRAPH_LAT_HDRH_DESC = {
266 "result_latency_forward_pdr_0_hdrh": "No-load.",
267 "result_latency_reverse_pdr_0_hdrh": "No-load.",
268 "result_latency_forward_pdr_10_hdrh": "Low-load, 10% PDR.",
269 "result_latency_reverse_pdr_10_hdrh": "Low-load, 10% PDR.",
270 "result_latency_forward_pdr_50_hdrh": "Mid-load, 50% PDR.",
271 "result_latency_reverse_pdr_50_hdrh": "Mid-load, 50% PDR.",
272 "result_latency_forward_pdr_90_hdrh": "High-load, 90% PDR.",
273 "result_latency_reverse_pdr_90_hdrh": "High-load, 90% PDR."
276 # Operators used to filter data in comparison tables.
285 ("datestartswith ", )
288 ############################################################################
292 NEWS_TITLE = "Failures and Anomalies"
294 # The pathname prefix for the application.
295 NEWS_ROUTES_PATHNAME_PREFIX = "/news/"
297 # Time period for regressions and progressions.
298 NEWS_TIME_PERIOD = TIME_PERIOD # [days]
300 # Time periods for summary tables.
301 NEWS_LAST = 1 # [days]
302 NEWS_SHORT = 7 # [days]
303 NEWS_LONG = NEWS_TIME_PERIOD # [days]
305 ############################################################################
309 REPORT_TITLE = "Per Release Performance"
311 # The pathname prefix for the application.
312 REPORT_ROUTES_PATHNAME_PREFIX = "/report/"
314 # Layout of plot.ly graphs.
315 REPORT_GRAPH_LAYOUT_FILE = "cdash/report/layout.yaml"
317 # Default name of downloaded file with selected data.
318 REPORT_DOWNLOAD_FILE_NAME = "iterative_data.csv"
320 ############################################################################
324 COMP_TITLE = "Per Release Performance Comparisons"
326 # The pathname prefix for the application.
327 COMP_ROUTES_PATHNAME_PREFIX = "/comparisons/"
329 # Default name of downloaded file with selected data.
330 COMP_DOWNLOAD_FILE_NAME = "comparison_data.csv"
332 ############################################################################
336 STATS_TITLE = "Test Job Statistics"
338 # The pathname prefix for the application.
339 STATS_ROUTES_PATHNAME_PREFIX = "/stats/"
341 # Layout of plot.ly graphs.
342 STATS_GRAPH_LAYOUT_FILE = "cdash/stats/layout.yaml"
344 # The default job displayed when the page is loaded first time.
345 STATS_DEFAULT_JOB = "csit-vpp-perf-mrr-daily-master-2n-icx"
347 # Default name of downloaded file with selected data.
348 STATS_DOWNLOAD_FILE_NAME = "stats.csv"
350 ############################################################################
354 TREND_TITLE = "Performance Trending"
356 # The pathname prefix for the application.
357 TREND_ROUTES_PATHNAME_PREFIX = "/trending/"
359 # Layout of plot.ly graphs.
360 TREND_GRAPH_LAYOUT_FILE = "cdash/trending/layout.yaml"
362 # Default name of downloaded file with selected data.
363 TREND_DOWNLOAD_FILE_NAME = "trending_data.csv"
365 ############################################################################
369 COVERAGE_TITLE = "Per Release Coverage Data"
371 # The pathname prefix for the application.
372 COVERAGE_ROUTES_PATHNAME_PREFIX = "/coverage/"
374 # Default name of downloaded file with selected data.
375 COVERAGE_DOWNLOAD_FILE_NAME = "coverage_data.csv"
377 ############################################################################