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 # URL to the documentation
48 URL_DOC_TRENDING = "https://csit.fd.io/cdocs/methodology/trending/analysis/"
49 URL_DOC_REL_NOTES = "https://csit.fd.io/cdocs/release_notes/csit_rls2306/"
51 # Path and name of the file specifying the HTML layout of the dash
53 MAIN_HTML_LAYOUT_FILE = "base_layout.jinja2"
55 # Path and name of the file specifying the HTML layout of the dash
57 HTML_LAYOUT_FILE = "cdash/templates/dash_layout.jinja2"
62 # Data to be downloaded from the parquets specification file.
63 DATA_SPEC_FILE = "cdash/data/data.yaml"
65 # The file with tooltips.
66 TOOLTIP_FILE = "cdash/utils/tooltips.yaml"
68 # Maximal value of TIME_PERIOD for data read from the parquets in days.
69 # Do not change without a good reason.
72 # It defines the time period for data read from the parquets in days from
73 # now back to the past.
74 # TIME_PERIOD = None - means all data (max MAX_TIME_PERIOD days) is read.
75 # TIME_PERIOD = MAX_TIME_PERIOD - is the default value
76 TIME_PERIOD = MAX_TIME_PERIOD # [days]
78 ############################################################################
79 # General, application wide, layout affecting constants.
81 # Add a time delay (in ms) to the spinner being shown
84 # If True, clear all inputs in control panel when button "ADD SELECTED" is
86 CLEAR_ALL_INPUTS = False
88 # The element is disabled.
89 STYLE_DISABLED = {"visibility": "hidden"}
91 # The element is enabled and visible.
92 STYLE_ENABLED = {"visibility": "visible"}
94 # Checklist "All" is disabled.
103 # Checklist "All" is enabled, visible and unchecked.
112 # Placeholder for any element in the layout.
113 PLACEHOLDER = html.Nobr("")
115 # List of drivers used in CSIT.
116 DRIVERS = ("avf", "af-xdp", "rdma", "dpdk", "mlx5")
118 # Labels for input elements (dropdowns, ...).
121 "container_memif": "LXC/DRC Container Memif",
122 "crypto": "IPSec IPv4 Routing",
123 "ip4": "IPv4 Routing",
124 "ip4_tunnels": "IPv4 Tunnels",
125 "ip6": "IPv6 Routing",
126 "ip6_tunnels": "IPv6 Tunnels",
127 "l2": "L2 Ethernet Switching",
128 "lb": "Load Balancer",
129 "srv6": "SRv6 Routing",
130 "vm_vhost": "VMs vhost-user",
131 "nfv_density.dcr_memif.chain_ipsec": "CNF Service Chains Routing IPSec",
132 "nfv_density.vm_vhost.chain_dot1qip4vxlan":"VNF Service Chains Tunnels",
133 "nfv_density.vm_vhost.chain": "VNF Service Chains Routing",
134 "nfv_density.dcr_memif.pipeline": "CNF Service Pipelines Routing",
135 "nfv_density.dcr_memif.chain": "CNF Service Chains Routing",
136 "hoststack": "Hoststack",
138 "l2bd": "L2 Bridge Domain",
139 "crypto.ethip4": "IPSec IPv4 Routing",
140 "crypto.ethip6": "IPSec IPv6 Routing",
141 "interfaces": "Interfaces",
142 "ip4_tunnels.lisp": "IPv4 Tunnels LISP",
143 "ip6_tunnels.lisp": "IPv6 Tunnels LISP",
144 "l2patch": "L2 Patch",
145 "l2xc": "L2 Cross Connect",
146 "vm_vhost.ethip4": "VMs vhost-user IPv4 Routing",
147 "vm_vhost.ethip6": "VMs vhost-user IPv6 Routing"
152 "background-color": "#d2ebf5",
153 "border-color": "#bce1f1",
157 ############################################################################
158 # General, normalization constants.
160 NORM_FREQUENCY = 2.0 # [GHz]
161 FREQUENCY = { # [GHz]
182 ############################################################################
183 # General, plots and tables constants.
186 "#1A1110", "#DA2647", "#214FC6", "#01786F", "#BD8260", "#FFD12A",
187 "#A6E7FF", "#738276", "#C95A49", "#FC5A8D", "#CEC8EF", "#391285",
188 "#6F2DA8", "#FF878D", "#45A27D", "#FFD0B9", "#FD5240", "#DB91EF",
189 "#44D7A8", "#4F86F7", "#84DE02", "#FFCFF1", "#614051"
192 # Trending, anomalies.
208 TICK_TEXT_TPUT = ["Regression", "Normal", "Progression"]
219 TICK_TEXT_LAT = ["Progression", "Normal", "Regression"]
221 # Access to the results.
223 "mrr": "result_receive_rate_rate_avg",
224 "ndr": "result_ndr_lower_rate_value",
225 "pdr": "result_pdr_lower_rate_value",
226 "latency": "result_latency_forward_pdr_50_avg",
227 "hoststack-cps": "result_rate_value",
228 "hoststack-rps": "result_rate_value",
229 "hoststack-bps": "result_bandwidth_value",
230 "hoststack-latency": "result_latency_value"
234 "mrr": "result_receive_rate_rate_values",
235 "ndr": "result_ndr_lower_rate_value",
236 "pdr": "result_pdr_lower_rate_value",
237 "latency": "result_latency_forward_pdr_50_avg",
238 "hoststack-cps": "result_rate_value",
239 "hoststack-rps": "result_rate_value",
240 "hoststack-bps": "result_bandwidth_value",
241 "hoststack-latency": "result_latency_value"
245 "mrr": "result_receive_rate_rate_unit",
246 "ndr": "result_ndr_lower_rate_unit",
247 "pdr": "result_pdr_lower_rate_unit",
248 "latency": "result_latency_forward_pdr_50_unit",
249 "hoststack-cps": "result_rate_unit",
250 "hoststack-rps": "result_rate_unit",
251 "hoststack-bps": "result_bandwidth_unit",
252 "hoststack-latency": "result_latency_unit"
256 LAT_HDRH = ( # Do not change the order
257 "result_latency_forward_pdr_0_hdrh",
258 "result_latency_reverse_pdr_0_hdrh",
259 "result_latency_forward_pdr_10_hdrh",
260 "result_latency_reverse_pdr_10_hdrh",
261 "result_latency_forward_pdr_50_hdrh",
262 "result_latency_reverse_pdr_50_hdrh",
263 "result_latency_forward_pdr_90_hdrh",
264 "result_latency_reverse_pdr_90_hdrh",
267 # This value depends on latency stream rate (9001 pps) and duration (5s).
268 # Keep it slightly higher to ensure rounding errors to not remove tick mark.
269 PERCENTILE_MAX = 99.999501
271 GRAPH_LAT_HDRH_DESC = {
272 "result_latency_forward_pdr_0_hdrh": "No-load.",
273 "result_latency_reverse_pdr_0_hdrh": "No-load.",
274 "result_latency_forward_pdr_10_hdrh": "Low-load, 10% PDR.",
275 "result_latency_reverse_pdr_10_hdrh": "Low-load, 10% PDR.",
276 "result_latency_forward_pdr_50_hdrh": "Mid-load, 50% PDR.",
277 "result_latency_reverse_pdr_50_hdrh": "Mid-load, 50% PDR.",
278 "result_latency_forward_pdr_90_hdrh": "High-load, 90% PDR.",
279 "result_latency_reverse_pdr_90_hdrh": "High-load, 90% PDR."
282 # Operators used to filter data in comparison tables.
291 ("datestartswith ", )
294 ############################################################################
298 NEWS_TITLE = "Failures and Anomalies"
300 # The pathname prefix for the application.
301 NEWS_ROUTES_PATHNAME_PREFIX = "/news/"
303 # Time period for regressions and progressions.
304 NEWS_TIME_PERIOD = TIME_PERIOD # [days]
306 # Time periods for summary tables.
307 NEWS_LAST = 1 # [days]
308 NEWS_SHORT = 7 # [days]
309 NEWS_LONG = NEWS_TIME_PERIOD # [days]
311 ############################################################################
315 REPORT_TITLE = "Per Release Performance"
317 # The pathname prefix for the application.
318 REPORT_ROUTES_PATHNAME_PREFIX = "/report/"
320 # Layout of plot.ly graphs.
321 REPORT_GRAPH_LAYOUT_FILE = "cdash/report/layout.yaml"
323 # Default name of downloaded file with selected data.
324 REPORT_DOWNLOAD_FILE_NAME = "iterative_data.csv"
326 ############################################################################
330 COMP_TITLE = "Per Release Performance Comparisons"
332 # The pathname prefix for the application.
333 COMP_ROUTES_PATHNAME_PREFIX = "/comparisons/"
335 # Default name of downloaded file with selected data.
336 COMP_DOWNLOAD_FILE_NAME = "comparison_data.csv"
338 ############################################################################
342 STATS_TITLE = "Test Job Statistics"
344 # The pathname prefix for the application.
345 STATS_ROUTES_PATHNAME_PREFIX = "/stats/"
347 # Layout of plot.ly graphs.
348 STATS_GRAPH_LAYOUT_FILE = "cdash/stats/layout.yaml"
350 # The default job displayed when the page is loaded first time.
351 STATS_DEFAULT_JOB = "csit-vpp-perf-mrr-daily-master-2n-icx"
353 # Default name of downloaded file with selected data.
354 STATS_DOWNLOAD_FILE_NAME = "stats.csv"
356 ############################################################################
360 TREND_TITLE = "Performance Trending"
362 # The pathname prefix for the application.
363 TREND_ROUTES_PATHNAME_PREFIX = "/trending/"
365 # Layout of plot.ly graphs.
366 TREND_GRAPH_LAYOUT_FILE = "cdash/trending/layout.yaml"
368 # Default name of downloaded file with selected data.
369 TREND_DOWNLOAD_FILE_NAME = "trending_data.csv"
370 TELEMETRY_DOWNLOAD_FILE_NAME = "telemetry_data.csv"
372 ############################################################################
376 COVERAGE_TITLE = "Per Release Coverage Data"
378 # The pathname prefix for the application.
379 COVERAGE_ROUTES_PATHNAME_PREFIX = "/coverage/"
381 # Default name of downloaded file with selected data.
382 COVERAGE_DOWNLOAD_FILE_NAME = "coverage_data.csv"
384 ############################################################################