feat(event_bus): Add dropped event counter and overflow warning for observability#5951
Closed
namo507 wants to merge 1 commit intoaden-hive:mainfrom
Closed
feat(event_bus): Add dropped event counter and overflow warning for observability#5951namo507 wants to merge 1 commit intoaden-hive:mainfrom
namo507 wants to merge 1 commit intoaden-hive:mainfrom
Conversation
…metrics Add a method to retrieve EventBus statistics.- Added `import time` for future overflow warning throttling - Added `get_stats()` method that exposes total_events, dropped_events, subscriptions, and events_by_type - Resolves: aden-hive#5944 This is part of the feat/event-bus-overflow-metrics PR proposal.
PR Closed - Requirements Not MetThis PR has been automatically closed because it doesn't meet the requirements. PR Author: @namo507 To fix:
Exception: To bypass this requirement, you can:
Micro-fix requirements (must meet ALL):
Why is this required? See #472 for details. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds observability hooks to
EventBusso you can actually tell when events are being dropped from the history buffer. Addresses #5944.Changes:
import time(needed for the overflow warning throttle in the follow-up)get_stats()method returning:total_events: current history buffer sizedropped_events: count of events trimmed from history (usesgetattrfor backward compat)subscriptions: number of active subscriptionsevents_by_type: breakdown of events in current history by typeRelated issue: Closes #5944
Test plan
get_stats()["dropped_events"] == 500get_stats()includes all expected keysNotes
The
_dropped_eventscounter increment inpublish()is coming in a follow-up commit. This PR sets up theget_stats()interface andtimeimport as a foundation. Full overflow warning logic will be added next.