Add 2048B file size cps rps tests in job specs for http-ldpreload-nginx-1_21_5.
[csit.git] / csit.infra.dash / app / cdash / utils / constants.py
1 # Copyright (c) 2024 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:
5 #
6 #     http://www.apache.org/licenses/LICENSE-2.0
7 #
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.
13
14 """Constants used in CDash.
15
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.
18 """
19
20 import logging
21
22 from dash import html
23
24
25 class Constants:
26     """Constants used in CDash.
27     """
28
29     ############################################################################
30     # General, application wide constants.
31
32     # Logging settings.
33     LOG_LEVEL = logging.INFO
34     LOG_FORMAT = "%(asctime)s: %(levelname)s: %(message)s"
35     LOG_DATE_FORMAT = "%Y/%m/%d %H:%M:%S"
36
37     # The application title.
38     TITLE = "FD.io CSIT"
39     BRAND = "CSIT-Dash"
40
41     # The application description.
42     DESCRIPTION = "Performance Dashboard"
43
44     # External stylesheets.
45     EXTERNAL_STYLESHEETS = ["/static/dist/css/bootstrap.css", ]
46
47     # URL to Jenkins
48     URL_JENKINS = "https://jenkins.fd.io/job/"
49
50     # URL to logs
51     URL_LOGS = "https://logs.fd.io/vex-yul-rot-jenkins-1/"
52
53     # URL to the documentation
54     URL_DOC_TRENDING = "https://csit.fd.io/cdocs/methodology/trending/analysis/"
55     URL_DOC_REL_NOTES = "https://csit.fd.io/cdocs/release_notes/current/"
56
57     # Path and name of the file specifying the HTML layout of the dash
58     # application.
59     MAIN_HTML_LAYOUT_FILE = "base_layout.jinja2"
60
61     # Path and name of the file specifying the HTML layout of the dash
62     # application.
63     HTML_LAYOUT_FILE = "cdash/templates/dash_layout.jinja2"
64
65     # Application root.
66     APPLICATIN_ROOT = "/"
67
68     # Data to be downloaded from the parquets specification file.
69     DATA_SPEC_FILE = "cdash/data/data.yaml"
70
71     # Path to schemas to use when reading data from the parquet.
72     PATH_TO_SCHEMAS = "cdash/data/_metadata/"
73
74     # The file with tooltips.
75     TOOLTIP_FILE = "cdash/utils/tooltips.yaml"
76
77     # Maximal value of TIME_PERIOD for data read from the parquets in days.
78     # Do not change without a good reason.
79     MAX_TIME_PERIOD = 250
80
81     # It defines the time period for data read from the parquets in days from
82     # now back to the past.
83     # TIME_PERIOD = None - means all data (max MAX_TIME_PERIOD days) is read.
84     # TIME_PERIOD = MAX_TIME_PERIOD - is the default value
85     TIME_PERIOD = MAX_TIME_PERIOD  # [days]
86
87     ############################################################################
88     # General, application wide, layout affecting constants.
89
90     # Add a time delay (in ms) to the spinner being shown
91     SPINNER_DELAY = 500
92
93     # If True, clear all inputs in control panel when button "ADD SELECTED" is
94     # pressed.
95     CLEAR_ALL_INPUTS = False
96
97     # The element is disabled.
98     STYLE_DISABLED = {"visibility": "hidden"}
99
100     # The element is enabled and visible.
101     STYLE_ENABLED = {"visibility": "visible"}
102
103     # The element is not displayed.
104     STYLE_DONT_DISPLAY = {"display": "none"}
105
106     # The element is displaed.
107     STYLE_DISPLAY = {"display": "flex"}
108
109     # Checklist "All" is disabled.
110     CL_ALL_DISABLED = [
111         {
112             "label": "All",
113             "value": "all",
114             "disabled": True
115         }
116     ]
117
118     # Checklist "All" is enabled, visible and unchecked.
119     CL_ALL_ENABLED = [
120         {
121             "label": "All",
122             "value": "all",
123             "disabled": False
124         }
125     ]
126
127     # Placeholder for any element in the layout.
128     PLACEHOLDER = html.Nobr("")
129
130     # List of drivers used in CSIT.
131     DRIVERS = ("avf", "af-xdp", "rdma", "dpdk", "mlx5")
132
133     # Labels for input elements (dropdowns, ...).
134     LABELS = {
135         "dpdk": "DPDK",
136         "container_memif": "LXC/DRC Container Memif",
137         "crypto": "IPSec IPv4 Routing",
138         "gso": "GSO",
139         "ip4": "IPv4 Routing",
140         "ip4_tunnels": "IPv4 Tunnels",
141         "ip6": "IPv6 Routing",
142         "ip6_tunnels": "IPv6 Tunnels",
143         "l2": "L2 Ethernet Switching",
144         "lb": "Load Balancer",
145         "srv6": "SRv6 Routing",
146         "vm_vhost": "VMs vhost-user",
147         "nfv_density.dcr_memif.chain_ipsec": "CNF Service Chains Routing IPSec",
148         "nfv_density.vm_vhost.chain_dot1qip4vxlan":"VNF Service Chains Tunnels",
149         "nfv_density.vm_vhost.chain": "VNF Service Chains Routing",
150         "nfv_density.dcr_memif.pipeline": "CNF Service Pipelines Routing",
151         "nfv_density.dcr_memif.chain": "CNF Service Chains Routing",
152         "hoststack": "Hoststack",
153         "flow": "Flow",
154         "l2bd": "L2 Bridge Domain",
155         "crypto.ethip4": "IPSec IPv4 Routing",
156         "crypto.ethip6": "IPSec IPv6 Routing",
157         "interfaces": "Interfaces",
158         "ip4_tunnels.lisp": "IPv4 Tunnels LISP",
159         "ip6_tunnels.lisp": "IPv6 Tunnels LISP",
160         "l2patch": "L2 Patch",
161         "l2xc": "L2 Cross Connect",
162         "vm_vhost.ethip4": "VMs vhost-user IPv4 Routing",
163         "vm_vhost.ethip6": "VMs vhost-user IPv6 Routing"
164     }
165
166     # URL style.
167     URL_STYLE = {
168         "background-color": "#d2ebf5",
169         "border-color": "#bce1f1",
170         "color": "#135d7c"
171     }
172
173     ############################################################################
174     # General, normalization constants.
175
176     NORM_FREQUENCY = 2.0  # [GHz]
177     FREQUENCY = {  # [GHz]
178         "1n-aws": 3.400,
179         "2n-aws": 3.400,
180         "2n-c6in": 3.500,
181         "2n-clx": 2.300,
182         "2n-icx": 2.600,
183         "2n-spr": 2.800,
184         "2n-tx2": 2.500,
185         "2n-zn2": 2.900,
186         "3n-alt": 3.000,
187         "3n-icx": 2.600,
188         "3n-icxd": 2.000,
189         "3n-snr": 2.200,
190         "3n-tsh": 2.200,
191         "3na-spr": 2.800,
192         "3nb-spr": 2.800
193     }
194
195     ############################################################################
196     # General, plots and tables constants.
197
198     PLOT_COLORS = (
199         "#1A1110", "#DA2647", "#214FC6", "#01786F", "#BD8260", "#FFD12A",
200         "#A6E7FF", "#738276", "#C95A49", "#FC5A8D", "#CEC8EF", "#391285",
201         "#6F2DA8", "#FF878D", "#45A27D", "#FFD0B9", "#FD5240", "#DB91EF",
202         "#44D7A8", "#4F86F7", "#84DE02", "#FFCFF1", "#614051"
203     )
204
205     # Trending, anomalies.
206     ANOMALY_COLOR = {
207         "regression": 0.0,
208         "normal": 0.5,
209         "progression": 1.0
210     }
211
212     COLORSCALE_TPUT = [
213         [0.00, "red"],
214         [0.33, "red"],
215         [0.33, "white"],
216         [0.66, "white"],
217         [0.66, "green"],
218         [1.00, "green"]
219     ]
220
221     TICK_TEXT_TPUT = ["Regression", "Normal", "Progression"]
222
223     COLORSCALE_LAT = [
224         [0.00, "green"],
225         [0.33, "green"],
226         [0.33, "white"],
227         [0.66, "white"],
228         [0.66, "red"],
229         [1.00, "red"]
230     ]
231
232     TICK_TEXT_LAT = ["Progression", "Normal", "Regression"]
233
234     # Access to the results.
235     VALUE = {
236         "mrr": "result_receive_rate_rate_avg",
237         "ndr": "result_ndr_lower_rate_value",
238         "pdr": "result_pdr_lower_rate_value",
239         "mrr-bandwidth": "result_receive_rate_bandwidth_avg",
240         "ndr-bandwidth": "result_ndr_lower_bandwidth_value",
241         "pdr-bandwidth": "result_pdr_lower_bandwidth_value",
242         "latency": "result_latency_forward_pdr_50_avg",
243         "hoststack-cps": "result_rate_value",
244         "hoststack-rps": "result_rate_value",
245         "hoststack-cps-bandwidth": "result_bandwidth_value",
246         "hoststack-rps-bandwidth": "result_bandwidth_value",
247         "hoststack-bps": "result_bandwidth_value",
248         "hoststack-latency": "result_latency_value",
249         "soak": "result_critical_rate_lower_rate_value",
250         "soak-bandwidth": "result_critical_rate_lower_bandwidth_value"
251     }
252
253     VALUE_ITER = {
254         "mrr": "result_receive_rate_rate_values",
255         "ndr": "result_ndr_lower_rate_value",
256         "pdr": "result_pdr_lower_rate_value",
257         "mrr-bandwidth": "result_receive_rate_bandwidth_avg",
258         "ndr-bandwidth": "result_ndr_lower_bandwidth_value",
259         "pdr-bandwidth": "result_pdr_lower_bandwidth_value",
260         "latency": "result_latency_forward_pdr_50_avg",
261         "hoststack-cps": "result_rate_value",
262         "hoststack-rps": "result_rate_value",
263         "hoststack-cps-bandwidth": "result_bandwidth_value",
264         "hoststack-rps-bandwidth": "result_bandwidth_value",
265         "hoststack-bps": "result_bandwidth_value",
266         "hoststack-latency": "result_latency_value",
267         "soak": "result_critical_rate_lower_rate_value",
268         "soak-bandwidth": "result_critical_rate_lower_bandwidth_value"
269     }
270
271     UNIT = {
272         "mrr": "result_receive_rate_rate_unit",
273         "ndr": "result_ndr_lower_rate_unit",
274         "pdr": "result_pdr_lower_rate_unit",
275         "mrr-bandwidth": "result_receive_rate_bandwidth_unit",
276         "ndr-bandwidth": "result_ndr_lower_bandwidth_unit",
277         "pdr-bandwidth": "result_pdr_lower_bandwidth_unit",
278         "latency": "result_latency_forward_pdr_50_unit",
279         "hoststack-cps": "result_rate_unit",
280         "hoststack-rps": "result_rate_unit",
281         "hoststack-cps-bandwidth": "result_bandwidth_unit",
282         "hoststack-rps-bandwidth": "result_bandwidth_unit",
283         "hoststack-bps": "result_bandwidth_unit",
284         "hoststack-latency": "result_latency_unit",
285         "soak": "result_critical_rate_lower_rate_unit",
286         "soak-bandwidth": "result_critical_rate_lower_bandwidth_unit"
287     }
288
289     TESTS_WITH_BANDWIDTH = (
290         "ndr",
291         "pdr",
292         "mrr",
293         "hoststack-cps",
294         "hoststack-rps",
295         "soak"
296     )
297     TESTS_WITH_LATENCY = (
298         "pdr",
299         "hoststack-cps",
300         "hoststack-rps"
301     )
302
303     # Latencies.
304     LAT_HDRH = (  # Do not change the order
305         "result_latency_forward_pdr_0_hdrh",
306         "result_latency_reverse_pdr_0_hdrh",
307         "result_latency_forward_pdr_10_hdrh",
308         "result_latency_reverse_pdr_10_hdrh",
309         "result_latency_forward_pdr_50_hdrh",
310         "result_latency_reverse_pdr_50_hdrh",
311         "result_latency_forward_pdr_90_hdrh",
312         "result_latency_reverse_pdr_90_hdrh",
313     )
314
315     # This value depends on latency stream rate (9001 pps) and duration (5s).
316     # Keep it slightly higher to ensure rounding errors to not remove tick mark.
317     PERCENTILE_MAX = 99.999501
318
319     GRAPH_LAT_HDRH_DESC = {
320         "result_latency_forward_pdr_0_hdrh": "No-load.",
321         "result_latency_reverse_pdr_0_hdrh": "No-load.",
322         "result_latency_forward_pdr_10_hdrh": "Low-load, 10% PDR.",
323         "result_latency_reverse_pdr_10_hdrh": "Low-load, 10% PDR.",
324         "result_latency_forward_pdr_50_hdrh": "Mid-load, 50% PDR.",
325         "result_latency_reverse_pdr_50_hdrh": "Mid-load, 50% PDR.",
326         "result_latency_forward_pdr_90_hdrh": "High-load, 90% PDR.",
327         "result_latency_reverse_pdr_90_hdrh": "High-load, 90% PDR."
328     }
329
330     # Operators used to filter data in comparison tables.
331     OPERATORS = (
332         ("contains ", ),
333         ("lt ", "<"),
334         ("gt ", ">"),
335         ("eq ", "="),
336         ("ge ", ">="),
337         ("le ", "<="),
338         ("ne ", "!="),
339         ("datestartswith ", )
340     )
341
342     ############################################################################
343     # News.
344
345     # The title.
346     NEWS_TITLE = "Failures and Anomalies"
347
348     # The pathname prefix for the application.
349     NEWS_ROUTES_PATHNAME_PREFIX = "/news/"
350
351     # Time period for regressions and progressions.
352     NEWS_TIME_PERIOD = TIME_PERIOD  # [days]
353
354     # Time periods for summary tables.
355     NEWS_LAST = 1  # [days]
356     NEWS_SHORT = 7  # [days]
357     NEWS_LONG = NEWS_TIME_PERIOD  # [days]
358
359     ############################################################################
360     # Report.
361
362     # The title.
363     REPORT_TITLE = "Per Release Performance"
364
365     # The pathname prefix for the application.
366     REPORT_ROUTES_PATHNAME_PREFIX = "/report/"
367
368     # Layout of plot.ly graphs.
369     REPORT_GRAPH_LAYOUT_FILE = "cdash/report/layout.yaml"
370
371     # Default name of downloaded file with selected data.
372     REPORT_DOWNLOAD_FILE_NAME = "iterative_data.csv"
373
374     ############################################################################
375     # Comparisons.
376
377     # The title.
378     COMP_TITLE = "Per Release Performance Comparisons"
379
380     # The pathname prefix for the application.
381     COMP_ROUTES_PATHNAME_PREFIX = "/comparisons/"
382
383     # Default name of downloaded file with selected data.
384     COMP_DOWNLOAD_FILE_NAME = "comparison_data.csv"
385
386     # This parameter specifies the method to use for estimating the percentile.
387     # Possible values:
388     # - inverted_cdf
389     # - averaged_inverted_cdf
390     # - closest_observation
391     # - interpolated_inverted_cdf
392     # - hazen
393     # - weibull
394     # - linear (default)
395     # - median_unbiased
396     # - normal_unbiased
397     COMP_PERCENTILE_METHOD = "linear"
398
399     # Extreme or mild outlier?
400     OUTLIER_EXTREME = 3
401     OUTLIER_MILD = 1.5
402     COMP_OUTLIER_TYPE = OUTLIER_EXTREME
403
404     ############################################################################
405     # Statistics.
406
407     # The title.
408     STATS_TITLE = "Test Job Statistics"
409
410     # The pathname prefix for the application.
411     STATS_ROUTES_PATHNAME_PREFIX = "/stats/"
412
413     # Layout of plot.ly graphs.
414     STATS_GRAPH_LAYOUT_FILE = "cdash/stats/layout.yaml"
415
416     # The default job displayed when the page is loaded first time.
417     STATS_DEFAULT_JOB = "csit-vpp-perf-mrr-daily-master-2n-icx"
418
419     # Default name of downloaded file with selected data.
420     STATS_DOWNLOAD_FILE_NAME = "stats.csv"
421
422     # The width of the bar in the graph in miliseconds.
423     STATS_BAR_WIDTH_DAILY = 1000 * 3600 * 15
424     STATS_BAR_WIDTH_WEEKLY = 1000 * 3600 * 24
425
426     ############################################################################
427     # Trending.
428
429     # The title.
430     TREND_TITLE = "Performance Trending"
431
432     # The pathname prefix for the application.
433     TREND_ROUTES_PATHNAME_PREFIX = "/trending/"
434
435     # Layout of plot.ly graphs.
436     TREND_GRAPH_LAYOUT_FILE = "cdash/trending/layout.yaml"
437
438     # Default name of downloaded file with selected data.
439     TREND_DOWNLOAD_FILE_NAME = "trending_data.csv"
440     TELEMETRY_DOWNLOAD_FILE_NAME = "telemetry_data.csv"
441
442     ############################################################################
443     # Coverage data.
444
445     # The title.
446     COVERAGE_TITLE = "Per Release Coverage Data"
447
448     # The pathname prefix for the application.
449     COVERAGE_ROUTES_PATHNAME_PREFIX = "/coverage/"
450
451     # Default name of downloaded file with selected data.
452     COVERAGE_DOWNLOAD_FILE_NAME = "coverage_data.csv"
453
454     ############################################################################
455     # Search tests.
456
457     # The title.
458     SEARCH_TITLE = "Search Tests"
459
460     # The pathname prefix for the application.
461     SEARCH_ROUTES_PATHNAME_PREFIX = "/search/"
462
463     # Layout of plot.ly graphs.
464     SEARCH_GRAPH_LAYOUT_FILE = "cdash/search/layout.yaml"
465
466     # Default name of downloaded file with selected data.
467     SEARCH_DOWNLOAD_FILE_NAME = "search_data.csv"
468
469     ############################################################################