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.
66 MAX_TIME_PERIOD = 150 # 180
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 # List of releases used for iterative data processing.
75 # The releases MUST be in the order from the current (newest) to the last
77 RELEASES = ["rls2302", "rls2210", "rls2206", ]
79 ############################################################################
80 # General, application wide, layout affecting constants.
82 # Add a time delay (in ms) to the spinner being shown
85 # If True, clear all inputs in control panel when button "ADD SELECTED" is
87 CLEAR_ALL_INPUTS = False
89 # The element is disabled.
90 STYLE_DISABLED = {"display": "none"}
92 # The element is enabled and visible.
93 STYLE_ENABLED = {"display": "inherit"}
95 # Checklist "All" is disabled.
104 # Checklist "All" is enabled, visible and unchecked.
113 # Placeholder for any element in the layout.
114 PLACEHOLDER = html.Nobr("")
116 # List of drivers used in CSIT.
117 DRIVERS = ("avf", "af-xdp", "rdma", "dpdk", "mlx5")
119 # Labels for input elements (dropdowns, ...).
122 "container_memif": "LXC/DRC Container Memif",
123 "crypto": "IPSec IPv4 Routing",
124 "ip4": "IPv4 Routing",
125 "ip6": "IPv6 Routing",
126 "ip4_tunnels": "IPv4 Tunnels",
127 "l2": "L2 Ethernet Switching",
128 "srv6": "SRv6 Routing",
129 "vm_vhost": "VMs vhost-user",
130 "nfv_density-dcr_memif-chain_ipsec": "CNF Service Chains Routing IPSec",
131 "nfv_density-vm_vhost-chain_dot1qip4vxlan":"VNF Service Chains Tunnels",
132 "nfv_density-vm_vhost-chain": "VNF Service Chains Routing",
133 "nfv_density-dcr_memif-pipeline": "CNF Service Pipelines Routing",
134 "nfv_density-dcr_memif-chain": "CNF Service Chains Routing",
139 "background-color": "#d2ebf5",
140 "border-color": "#bce1f1",
144 ############################################################################
145 # General, normalization constants.
147 NORM_FREQUENCY = 2.0 # [GHz]
148 FREQUENCY = { # [GHz]
165 ############################################################################
166 # General, plots constants.
169 "#1A1110", "#DA2647", "#214FC6", "#01786F", "#BD8260", "#FFD12A",
170 "#A6E7FF", "#738276", "#C95A49", "#FC5A8D", "#CEC8EF", "#391285",
171 "#6F2DA8", "#FF878D", "#45A27D", "#FFD0B9", "#FD5240", "#DB91EF",
172 "#44D7A8", "#4F86F7", "#84DE02", "#FFCFF1", "#614051"
175 # Trending, anomalies.
191 TICK_TEXT_TPUT = ["Regression", "Normal", "Progression"]
202 TICK_TEXT_LAT = ["Progression", "Normal", "Regression"]
204 # Access to the results.
206 "mrr": "result_receive_rate_rate_avg",
207 "ndr": "result_ndr_lower_rate_value",
208 "pdr": "result_pdr_lower_rate_value",
209 "pdr-lat": "result_latency_forward_pdr_50_avg"
213 "mrr": "result_receive_rate_rate_values",
214 "ndr": "result_ndr_lower_rate_value",
215 "pdr": "result_pdr_lower_rate_value",
216 "pdr-lat": "result_latency_forward_pdr_50_avg"
220 "mrr": "result_receive_rate_rate_unit",
221 "ndr": "result_ndr_lower_rate_unit",
222 "pdr": "result_pdr_lower_rate_unit",
223 "pdr-lat": "result_latency_forward_pdr_50_unit"
227 LAT_HDRH = ( # Do not change the order
228 "result_latency_forward_pdr_0_hdrh",
229 "result_latency_reverse_pdr_0_hdrh",
230 "result_latency_forward_pdr_10_hdrh",
231 "result_latency_reverse_pdr_10_hdrh",
232 "result_latency_forward_pdr_50_hdrh",
233 "result_latency_reverse_pdr_50_hdrh",
234 "result_latency_forward_pdr_90_hdrh",
235 "result_latency_reverse_pdr_90_hdrh",
238 # This value depends on latency stream rate (9001 pps) and duration (5s).
239 # Keep it slightly higher to ensure rounding errors to not remove tick mark.
240 PERCENTILE_MAX = 99.999501
242 GRAPH_LAT_HDRH_DESC = {
243 "result_latency_forward_pdr_0_hdrh": "No-load.",
244 "result_latency_reverse_pdr_0_hdrh": "No-load.",
245 "result_latency_forward_pdr_10_hdrh": "Low-load, 10% PDR.",
246 "result_latency_reverse_pdr_10_hdrh": "Low-load, 10% PDR.",
247 "result_latency_forward_pdr_50_hdrh": "Mid-load, 50% PDR.",
248 "result_latency_reverse_pdr_50_hdrh": "Mid-load, 50% PDR.",
249 "result_latency_forward_pdr_90_hdrh": "High-load, 90% PDR.",
250 "result_latency_reverse_pdr_90_hdrh": "High-load, 90% PDR."
253 ############################################################################
257 NEWS_TITLE = "Failures and Anomalies"
259 # The pathname prefix for the application.
260 NEWS_ROUTES_PATHNAME_PREFIX = "/news/"
262 # Time period for regressions and progressions.
263 NEWS_TIME_PERIOD = TIME_PERIOD # [days]
265 # Time periods for summary tables.
266 NEWS_LAST = 1 # [days]
267 NEWS_SHORT = 7 # [days]
268 NEWS_LONG = NEWS_TIME_PERIOD # [days]
270 ############################################################################
274 REPORT_TITLE = "Per Release Performance"
276 # The pathname prefix for the application.
277 REPORT_ROUTES_PATHNAME_PREFIX = "/report/"
279 # Layout of plot.ly graphs.
280 REPORT_GRAPH_LAYOUT_FILE = "cdash/report/layout.yaml"
282 # Default name of downloaded file with selected data.
283 REPORT_DOWNLOAD_FILE_NAME = "iterative_data.csv"
285 ############################################################################
289 STATS_TITLE = "Test Job Statistics"
291 # The pathname prefix for the application.
292 STATS_ROUTES_PATHNAME_PREFIX = "/stats/"
294 # Layout of plot.ly graphs.
295 STATS_GRAPH_LAYOUT_FILE = "cdash/stats/layout.yaml"
297 # The default job displayed when the page is loaded first time.
298 STATS_DEFAULT_JOB = "csit-vpp-perf-mrr-daily-master-2n-icx"
300 # Default name of downloaded file with selected data.
301 STATS_DOWNLOAD_FILE_NAME = "stats.csv"
303 ############################################################################
307 TREND_TITLE = "Performance Trending"
309 # The pathname prefix for the application.
310 TREND_ROUTES_PATHNAME_PREFIX = "/trending/"
312 # Layout of plot.ly graphs.
313 TREND_GRAPH_LAYOUT_FILE = "cdash/trending/layout.yaml"
315 # Default name of downloaded file with selected data.
316 TREND_DOWNLOAD_FILE_NAME = "trending_data.csv"