-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
user configurable event buffer size #4411
Conversation
# if and only if the event history deque will be completely filled by this event | ||
# fire warning that old events are now being dropped | ||
global EVENT_HISTORY | ||
if len(EVENT_HISTORY) == ((EVENT_HISTORY.maxlen or 100000) - 1): | ||
if len(EVENT_HISTORY) == (flags.EVENT_BUFFER_SIZE - 1): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nathaniel-may Sorry I missed this in the first PR feedback, but this pattern is required or fire_event(EventBufferFull())
will create a recursion loop. :|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ahh right.
@@ -88,25 +89,29 @@ def test_event_codes(self): | |||
|
|||
class TestEventBuffer(TestCase): | |||
|
|||
def setUp(self) -> None: | |||
flags.EVENT_BUFFER_SIZE = 10 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
much better
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@nathaniel-may @jtcohen6 -- Is there anything else additional I need to do to document the new flag? I'm not sure of the SOP for new ones. |
good question. I'm not sure. Maybe @leahwicz knows? |
I'm not sure but let's merge this PR and we can always open another PR for docs |
|
automatic commit by git-black, original commits: 2cd1f7d
resolves # No ticket-- follow on to #4358
Description
Add new global cli flag
EVENT_BUFFER_SIZE
to control the number of events buffered in memory during operation.Checklist
CHANGELOG.md
and added information about my change