Skip to content

(fix): add more debug logging. remove extra current_batch set #228

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Dec 16, 2019

Conversation

thomaszurkan-optimizely
Copy link
Contributor

@thomaszurkan-optimizely thomaszurkan-optimizely commented Dec 14, 2019

Summary

  • Added more logging for why flush was initiated and flush size.
  • Remove reset of current_batch that was not wrapped in a lock and was necessary after a call to flush_batch.

Test plan

  • Augmented test for flush once to include debug message for flushing with batch size.

@aliabbasrizvi
Copy link
Contributor

Please add a better Summary / Test Plan. You have taken the template values right now.

Copy link
Contributor

@aliabbasrizvi aliabbasrizvi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Conditionally approved on addressing provided feedback.

@@ -222,7 +222,7 @@ def flush(self):

def _flush_queue(self):
""" Flushes event_queue by dispatching events. """

self.logger.debug('Flushing the queue.')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually it will be better to look up if events are there and say nothing to flush if no events and then say flushing the queue if there are events. Also, perhaps number of user events flushed will be useful.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.006%) to 97.605% when pulling b776edc on loggingBranch into b156e21 on master.

5 similar comments
@coveralls
Copy link

Coverage Status

Coverage increased (+0.006%) to 97.605% when pulling b776edc on loggingBranch into b156e21 on master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.006%) to 97.605% when pulling b776edc on loggingBranch into b156e21 on master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.006%) to 97.605% when pulling b776edc on loggingBranch into b156e21 on master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.006%) to 97.605% when pulling b776edc on loggingBranch into b156e21 on master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.006%) to 97.605% when pulling b776edc on loggingBranch into b156e21 on master.

@coveralls
Copy link

coveralls commented Dec 16, 2019

Coverage Status

Coverage increased (+0.005%) to 97.604% when pulling 0c9adba on loggingBranch into b156e21 on master.

@@ -267,6 +270,7 @@ def _add_to_batch(self, user_event):
user_event: UserEvent Instance.
"""
if self._should_split(user_event):
self.logger.debug('Flush on split.')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit. Flushing and not flush.

…bug where current_batch was being reset without a lock.
@thomaszurkan-optimizely thomaszurkan-optimizely changed the title (fix): add more debug logging (fix): add more debug logging. remove extra current_batch set Dec 16, 2019
@thomaszurkan-optimizely thomaszurkan-optimizely merged commit 62c00f3 into master Dec 16, 2019
@thomaszurkan-optimizely thomaszurkan-optimizely deleted the loggingBranch branch December 16, 2019 17:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants