Skip to content

Commit

Permalink
Logging deviation from sampling expectation. This will allow to track…
Browse files Browse the repository at this point in the history
… performance variation in statesampler over time.
  • Loading branch information
pabloem committed Jan 30, 2018
1 parent 4593d97 commit e832cfb
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
Original file line number Diff line number Diff line change
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 e832cfb

Please sign in to comment.