From e832cfb5f2c3ef0d151f4133c5b1bfbbceb7a36f Mon Sep 17 00:00:00 2001 From: Pablo Date: Mon, 29 Jan 2018 17:06:18 -0800 Subject: [PATCH] Logging deviation from sampling expectation. This will allow to track performance variation in statesampler over time. --- sdks/python/apache_beam/runners/worker/statesampler_test.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sdks/python/apache_beam/runners/worker/statesampler_test.py b/sdks/python/apache_beam/runners/worker/statesampler_test.py index 63dc6f899bfc2..8b2216951dd34 100644 --- a/sdks/python/apache_beam/runners/worker/statesampler_test.py +++ b/sdks/python/apache_beam/runners/worker/statesampler_test.py @@ -74,6 +74,8 @@ def test_basic_sampler(self): self.assertIn(counter.name, expected_counter_values) expected_value = expected_counter_values[counter.name] actual_value = counter.value() + deviation = float(abs(actual_value - expected_value)) / expected_value + logging.info('Sampling deviation from expectation: %f', deviation) self.assertGreater(actual_value, expected_value * 0.75) self.assertLess(actual_value, expected_value * 1.25)