From 28efcb158bea961f83b71c6579dd88d9bf09345b Mon Sep 17 00:00:00 2001 From: gmarouli Date: Fri, 19 Dec 2025 11:37:08 +0200 Subject: [PATCH 1/3] Parse sampling value in DownsampleParamSource --- esrally/track/params.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/esrally/track/params.py b/esrally/track/params.py index ca5b2d5bc..1953dad78 100644 --- a/esrally/track/params.py +++ b/esrally/track/params.py @@ -866,9 +866,12 @@ def __init__(self, track, params, **kwargs): params["index"] = params.get("source-index") self._source_index = get_target(track, params) self._target_index = params.get("target-index", f"{self._source_index}-{self._fixed_interval}") + self._sampling_method = params.get("sampling-method", None) def params(self): parsed_params = {"fixed-interval": self._fixed_interval, "source-index": self._source_index, "target-index": self._target_index} + if self._sampling_method: + parsed_params["sampling-method"] = self._sampling_method parsed_params.update(self._client_params()) return parsed_params From 2377adc2e37c9c2f80edd40293c0f1440f7ececd Mon Sep 17 00:00:00 2001 From: gmarouli Date: Fri, 19 Dec 2025 11:47:33 +0200 Subject: [PATCH 2/3] Test the parsing of last value --- tests/track/params_test.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/track/params_test.py b/tests/track/params_test.py index 096fab5d2..0b1a79b8d 100644 --- a/tests/track/params_test.py +++ b/tests/track/params_test.py @@ -2958,6 +2958,7 @@ def test_downsample_all_params(self): "source-index": "test-source-index", "target-index": "test-target-index", "fixed-interval": "1m", + "sampling-method": "last_value" }, ) @@ -3010,3 +3011,4 @@ def test_downsample_empty_params(self): p = source.params() assert p["fixed-interval"] == "1h" assert p["target-index"] == f"{p['source-index']}-{p['fixed-interval']}" + assert p.get("sampling-method") is None From ba09aefa1d22f432b462f924173e824e2923eac2 Mon Sep 17 00:00:00 2001 From: gmarouli Date: Fri, 19 Dec 2025 11:51:23 +0200 Subject: [PATCH 3/3] Fix format --- tests/track/params_test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/track/params_test.py b/tests/track/params_test.py index 0b1a79b8d..86701bb28 100644 --- a/tests/track/params_test.py +++ b/tests/track/params_test.py @@ -2958,7 +2958,7 @@ def test_downsample_all_params(self): "source-index": "test-source-index", "target-index": "test-target-index", "fixed-interval": "1m", - "sampling-method": "last_value" + "sampling-method": "last_value", }, )