Skip to content

Commit

Permalink
Merge pull request #4531 from pabloem/log-sampler-deviation
Browse files Browse the repository at this point in the history
[BEAM-2732] Logging deviation from sampling expectation.
  • Loading branch information
aaltay committed Feb 3, 2018
2 parents 5e6520a + e832cfb commit 4f6415b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions sdks/python/apache_beam/runners/worker/statesampler_test.py
Expand Up @@ -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)

Expand Down

0 comments on commit 4f6415b

Please sign in to comment.