C-Dash: Add possiblity to remove outliers from comparison data
[csit.git] / csit.infra.dash / app / cdash / utils / constants.py
index 75cd68a..5ed5a8c 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (c) 2022 Cisco and/or its affiliates.
+# Copyright (c) 2024 Cisco and/or its affiliates.
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
 # You may obtain a copy of the License at:
@@ -39,17 +39,21 @@ class Constants:
     BRAND = "CSIT-Dash"
 
     # The application description.
-    DESCRIPTION = 'Performance Dashboard "CSIT-Dash"'
+    DESCRIPTION = "Performance Dashboard"
 
     # External stylesheets.
     EXTERNAL_STYLESHEETS = ["/static/dist/css/bootstrap.css", ]
 
-    # Top level template for all pages.
-    TEMPLATE = "d-flex h-100 text-center text-white bg-dark"
+    # URL to Jenkins
+    URL_JENKINS = "https://jenkins.fd.io/job/"
+
+    # URL to the documentation
+    URL_DOC_TRENDING = "https://csit.fd.io/cdocs/methodology/trending/analysis/"
+    URL_DOC_REL_NOTES = "https://csit.fd.io/cdocs/release_notes/current/"
 
     # Path and name of the file specifying the HTML layout of the dash
     # application.
-    MAIN_HTML_LAYOUT_FILE = "index_layout.jinja2"
+    MAIN_HTML_LAYOUT_FILE = "base_layout.jinja2"
 
     # Path and name of the file specifying the HTML layout of the dash
     # application.
@@ -61,12 +65,15 @@ class Constants:
     # Data to be downloaded from the parquets specification file.
     DATA_SPEC_FILE = "cdash/data/data.yaml"
 
+    # Path to schemas to use when reading data from the parquet.
+    PATH_TO_SCHEMAS = "cdash/data/_metadata/"
+
     # The file with tooltips.
     TOOLTIP_FILE = "cdash/utils/tooltips.yaml"
 
     # Maximal value of TIME_PERIOD for data read from the parquets in days.
     # Do not change without a good reason.
-    MAX_TIME_PERIOD = 180
+    MAX_TIME_PERIOD = 250
 
     # It defines the time period for data read from the parquets in days from
     # now back to the past.
@@ -74,23 +81,27 @@ class Constants:
     # TIME_PERIOD = MAX_TIME_PERIOD - is the default value
     TIME_PERIOD = MAX_TIME_PERIOD  # [days]
 
-    # List of releases used for iterative data processing.
-    # The releases MUST be in the order from the current (newest) to the last
-    # (oldest).
-    RELEASES = ["csit2210", "csit2206", "csit2202", ]
-
     ############################################################################
     # General, application wide, layout affecting constants.
 
+    # Add a time delay (in ms) to the spinner being shown
+    SPINNER_DELAY = 500
+
     # If True, clear all inputs in control panel when button "ADD SELECTED" is
     # pressed.
     CLEAR_ALL_INPUTS = False
 
     # The element is disabled.
-    STYLE_DISABLED = {"display": "none"}
+    STYLE_DISABLED = {"visibility": "hidden"}
 
     # The element is enabled and visible.
-    STYLE_ENABLED = {"display": "inherit"}
+    STYLE_ENABLED = {"visibility": "visible"}
+
+    # The element is not displayed.
+    STYLE_DONT_DISPLAY = {"display": "none"}
+
+    # The element is displaed.
+    STYLE_DISPLAY = {"display": "flex"}
 
     # Checklist "All" is disabled.
     CL_ALL_DISABLED = [
@@ -101,7 +112,7 @@ class Constants:
         }
     ]
 
-    # Checklist "All" is enable, visible and unchecked.
+    # Checklist "All" is enabled, visible and unchecked.
     CL_ALL_ENABLED = [
         {
             "label": "All",
@@ -114,24 +125,39 @@ class Constants:
     PLACEHOLDER = html.Nobr("")
 
     # List of drivers used in CSIT.
-    DRIVERS = ("avf", "af-xdp", "rdma", "dpdk")
+    DRIVERS = ("avf", "af-xdp", "rdma", "dpdk", "mlx5")
 
     # Labels for input elements (dropdowns, ...).
     LABELS = {
         "dpdk": "DPDK",
         "container_memif": "LXC/DRC Container Memif",
         "crypto": "IPSec IPv4 Routing",
+        "gso": "GSO",
         "ip4": "IPv4 Routing",
-        "ip6": "IPv6 Routing",
         "ip4_tunnels": "IPv4 Tunnels",
+        "ip6": "IPv6 Routing",
+        "ip6_tunnels": "IPv6 Tunnels",
         "l2": "L2 Ethernet Switching",
+        "lb": "Load Balancer",
         "srv6": "SRv6 Routing",
         "vm_vhost": "VMs vhost-user",
-        "nfv_density-dcr_memif-chain_ipsec": "CNF Service Chains Routing IPSec",
-        "nfv_density-vm_vhost-chain_dot1qip4vxlan":"VNF Service Chains Tunnels",
-        "nfv_density-vm_vhost-chain": "VNF Service Chains Routing",
-        "nfv_density-dcr_memif-pipeline": "CNF Service Pipelines Routing",
-        "nfv_density-dcr_memif-chain": "CNF Service Chains Routing",
+        "nfv_density.dcr_memif.chain_ipsec": "CNF Service Chains Routing IPSec",
+        "nfv_density.vm_vhost.chain_dot1qip4vxlan":"VNF Service Chains Tunnels",
+        "nfv_density.vm_vhost.chain": "VNF Service Chains Routing",
+        "nfv_density.dcr_memif.pipeline": "CNF Service Pipelines Routing",
+        "nfv_density.dcr_memif.chain": "CNF Service Chains Routing",
+        "hoststack": "Hoststack",
+        "flow": "Flow",
+        "l2bd": "L2 Bridge Domain",
+        "crypto.ethip4": "IPSec IPv4 Routing",
+        "crypto.ethip6": "IPSec IPv6 Routing",
+        "interfaces": "Interfaces",
+        "ip4_tunnels.lisp": "IPv4 Tunnels LISP",
+        "ip6_tunnels.lisp": "IPv6 Tunnels LISP",
+        "l2patch": "L2 Patch",
+        "l2xc": "L2 Cross Connect",
+        "vm_vhost.ethip4": "VMs vhost-user IPv4 Routing",
+        "vm_vhost.ethip6": "VMs vhost-user IPv6 Routing"
     }
 
     # URL style.
@@ -146,23 +172,25 @@ class Constants:
 
     NORM_FREQUENCY = 2.0  # [GHz]
     FREQUENCY = {  # [GHz]
-        "2n-aws": 1.000,
-        "2n-dnv": 2.000,
+        "1n-aws": 3.400,
+        "2n-aws": 3.400,
+        "2n-c6in": 3.500,
         "2n-clx": 2.300,
         "2n-icx": 2.600,
-        "2n-skx": 2.500,
+        "2n-spr": 2.800,
         "2n-tx2": 2.500,
         "2n-zn2": 2.900,
         "3n-alt": 3.000,
-        "3n-aws": 1.000,
-        "3n-dnv": 2.000,
         "3n-icx": 2.600,
-        "3n-skx": 2.500,
-        "3n-tsh": 2.200
+        "3n-icxd": 2.000,
+        "3n-snr": 2.200,
+        "3n-tsh": 2.200,
+        "3na-spr": 2.800,
+        "3nb-spr": 2.800
     }
 
     ############################################################################
-    # General, plots constants.
+    # General, plots and tables constants.
 
     PLOT_COLORS = (
         "#1A1110", "#DA2647", "#214FC6", "#01786F", "#BD8260", "#FFD12A",
@@ -205,21 +233,46 @@ class Constants:
         "mrr": "result_receive_rate_rate_avg",
         "ndr": "result_ndr_lower_rate_value",
         "pdr": "result_pdr_lower_rate_value",
-        "pdr-lat": "result_latency_forward_pdr_50_avg"
+        "mrr-bandwidth": "result_receive_rate_bandwidth_avg",
+        "ndr-bandwidth": "result_ndr_lower_bandwidth_value",
+        "pdr-bandwidth": "result_pdr_lower_bandwidth_value",
+        "latency": "result_latency_forward_pdr_50_avg",
+        "hoststack-cps": "result_rate_value",
+        "hoststack-rps": "result_rate_value",
+        "hoststack-cps-bandwidth": "result_bandwidth_value",
+        "hoststack-rps-bandwidth": "result_bandwidth_value",
+        "hoststack-bps": "result_bandwidth_value",
+        "hoststack-latency": "result_latency_value"
     }
 
     VALUE_ITER = {
         "mrr": "result_receive_rate_rate_values",
         "ndr": "result_ndr_lower_rate_value",
         "pdr": "result_pdr_lower_rate_value",
-        "pdr-lat": "result_latency_forward_pdr_50_avg"
+        "mrr-bandwidth": "result_receive_rate_bandwidth_avg",
+        "ndr-bandwidth": "result_ndr_lower_bandwidth_value",
+        "pdr-bandwidth": "result_pdr_lower_bandwidth_value",
+        "latency": "result_latency_forward_pdr_50_avg",
+        "hoststack-cps": "result_rate_value",
+        "hoststack-rps": "result_rate_value",
+        "hoststack-bps": "result_bandwidth_value",
+        "hoststack-latency": "result_latency_value"
     }
 
     UNIT = {
         "mrr": "result_receive_rate_rate_unit",
         "ndr": "result_ndr_lower_rate_unit",
         "pdr": "result_pdr_lower_rate_unit",
-        "pdr-lat": "result_latency_forward_pdr_50_unit"
+        "mrr-bandwidth": "result_receive_rate_bandwidth_unit",
+        "ndr-bandwidth": "result_ndr_lower_bandwidth_unit",
+        "pdr-bandwidth": "result_pdr_lower_bandwidth_unit",
+        "latency": "result_latency_forward_pdr_50_unit",
+        "hoststack-cps": "result_rate_unit",
+        "hoststack-rps": "result_rate_unit",
+        "hoststack-cps-bandwidth": "result_bandwidth_unit",
+        "hoststack-rps-bandwidth": "result_bandwidth_unit",
+        "hoststack-bps": "result_bandwidth_unit",
+        "hoststack-latency": "result_latency_unit"
     }
 
     # Latencies.
@@ -249,11 +302,23 @@ class Constants:
         "result_latency_reverse_pdr_90_hdrh": "High-load, 90% PDR."
     }
 
+    # Operators used to filter data in comparison tables.
+    OPERATORS = (
+        ("contains ", ),
+        ("lt ", "<"),
+        ("gt ", ">"),
+        ("eq ", "="),
+        ("ge ", ">="),
+        ("le ", "<="),
+        ("ne ", "!="),
+        ("datestartswith ", )
+    )
+
     ############################################################################
     # News.
 
     # The title.
-    NEWS_TITLE = "CI TEST FAILURE AND ANOMALY STATISTICS"
+    NEWS_TITLE = "Failures and Anomalies"
 
     # The pathname prefix for the application.
     NEWS_ROUTES_PATHNAME_PREFIX = "/news/"
@@ -270,7 +335,7 @@ class Constants:
     # Report.
 
     # The title.
-    REPORT_TITLE = "PER RELEASE PERFORMANCE RESULTS"
+    REPORT_TITLE = "Per Release Performance"
 
     # The pathname prefix for the application.
     REPORT_ROUTES_PATHNAME_PREFIX = "/report/"
@@ -281,19 +346,45 @@ class Constants:
     # Default name of downloaded file with selected data.
     REPORT_DOWNLOAD_FILE_NAME = "iterative_data.csv"
 
+    ############################################################################
+    # Comparisons.
+
+    # The title.
+    COMP_TITLE = "Per Release Performance Comparisons"
+
+    # The pathname prefix for the application.
+    COMP_ROUTES_PATHNAME_PREFIX = "/comparisons/"
+
+    # Default name of downloaded file with selected data.
+    COMP_DOWNLOAD_FILE_NAME = "comparison_data.csv"
+
+    # This parameter specifies the method to use for estimating the percentile.
+    # Possible values:
+    # - inverted_cdf
+    # - averaged_inverted_cdf
+    # - closest_observation
+    # - interpolated_inverted_cdf
+    # - hazen
+    # - weibull
+    # - linear (default)
+    # - median_unbiased
+    # - normal_unbiased
+    COMP_PERCENTILE_METHOD = "linear"
+
+    # Extreme or mild outlier?
+    OUTLIER_EXTREME = 3
+    OUTLIER_MILD = 1.5
+    COMP_OUTLIER_TYPE = OUTLIER_EXTREME
+
     ############################################################################
     # Statistics.
 
     # The title.
-    STATS_TITLE = "CI JOB EXECUTION STATISTICS"
+    STATS_TITLE = "Test Job Statistics"
 
     # The pathname prefix for the application.
     STATS_ROUTES_PATHNAME_PREFIX = "/stats/"
 
-    # Path and name of the file specifying the HTML layout of the dash
-    # application.
-    STATS_HTML_LAYOUT_FILE = "cdash/templates/stats_layout.jinja2"
-
     # Layout of plot.ly graphs.
     STATS_GRAPH_LAYOUT_FILE = "cdash/stats/layout.yaml"
 
@@ -303,21 +394,51 @@ class Constants:
     # Default name of downloaded file with selected data.
     STATS_DOWNLOAD_FILE_NAME = "stats.csv"
 
+    # The width of the bar in the graph in miliseconds.
+    STATS_BAR_WIDTH_DAILY = 1000 * 3600 * 15
+    STATS_BAR_WIDTH_WEEKLY = 1000 * 3600 * 24
+
     ############################################################################
     # Trending.
 
     # The title.
-    TREND_TITLE = "PERFORMANCE TRENDING (DAILY, WEEKLY)"
+    TREND_TITLE = "Performance Trending"
 
     # The pathname prefix for the application.
     TREND_ROUTES_PATHNAME_PREFIX = "/trending/"
 
-    # Path and name of the file specifying the HTML layout of the dash
-    # application.
-    TREND_HTML_LAYOUT_FILE = "cdash/templates/trending_layout.jinja2"
-
     # Layout of plot.ly graphs.
     TREND_GRAPH_LAYOUT_FILE = "cdash/trending/layout.yaml"
 
     # Default name of downloaded file with selected data.
     TREND_DOWNLOAD_FILE_NAME = "trending_data.csv"
+    TELEMETRY_DOWNLOAD_FILE_NAME = "telemetry_data.csv"
+
+    ############################################################################
+    # Coverage data.
+
+    # The title.
+    COVERAGE_TITLE = "Per Release Coverage Data"
+
+    # The pathname prefix for the application.
+    COVERAGE_ROUTES_PATHNAME_PREFIX = "/coverage/"
+
+    # Default name of downloaded file with selected data.
+    COVERAGE_DOWNLOAD_FILE_NAME = "coverage_data.csv"
+
+    ############################################################################
+    # Search tests.
+
+    # The title.
+    SEARCH_TITLE = "Search Tests"
+
+    # The pathname prefix for the application.
+    SEARCH_ROUTES_PATHNAME_PREFIX = "/search/"
+
+    # Layout of plot.ly graphs.
+    SEARCH_GRAPH_LAYOUT_FILE = "cdash/search/layout.yaml"
+
+    # Default name of downloaded file with selected data.
+    SEARCH_DOWNLOAD_FILE_NAME = "search_data.csv"
+
+    ############################################################################