diff --git a/defaults/test_default.yaml b/defaults/test_default.yaml index 1837a8ba46..b9add8ccc6 100644 --- a/defaults/test_default.yaml +++ b/defaults/test_default.yaml @@ -268,7 +268,7 @@ zero_token_instance_type_db: 'i4i.large' use_zero_nodes: false latte_schema_parameters: {} - +workload_name: '' latency_decorator_error_thresholds: write: default: diff --git a/sdcm/sct_config.py b/sdcm/sct_config.py index 4ed58fd62f..7635ebdedf 100644 --- a/sdcm/sct_config.py +++ b/sdcm/sct_config.py @@ -1738,6 +1738,10 @@ class SCTConfiguration(dict): help="Error thresholds for latency decorator." " Defined by dict: {: {:{: {: }}}"), + dict(name="workload_name", env="SCT_WORKLOAD_NAME", type=str, + help="Workload name, can be: write|read|mixed|unset." + "Used for e.g. latency_calculator_decorator (use with 'use_hdr_cs_histogram' set to true)." + "If unset, workload is taken from test name."), ] required_params = ['cluster_backend', 'test_duration', 'n_db_nodes', 'n_loaders', 'use_preinstalled_scylla', diff --git a/sdcm/utils/decorators.py b/sdcm/utils/decorators.py index 704513f4c2..da0db245db 100644 --- a/sdcm/utils/decorators.py +++ b/sdcm/utils/decorators.py @@ -162,6 +162,9 @@ def latency_calculator_decorator(original_function: Optional[Callable] = None, * """ Gets the start time, end time and then calculates the latency based on function 'calculate_latency'. + For proper usage, it requires workload name (write, read, mixed) to be included in the test name + or setting 'workload_name' test parameter. Also requires monitoring set and 'use_hdr_cs_histogram' test parameter to be set to True. + :param func: Remote method to run. :return: Wrapped method. """ @@ -212,6 +215,8 @@ def wrapped(*args, **kwargs): # noqa: PLR0914 workload = 'write' elif 'mixed' in test_name: workload = 'mixed' + elif tester.params.get('workload_name'): + workload = tester.params['workload_name'] else: return res