Skip to content
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

[interna/sharedcomponent] Use a ring buffer to restrict remembered status count #11826

Merged

Conversation

TylerHelmuth
Copy link
Member

Description

Use a ring buffer to only remember the last 5 events. This ensures we remember a reasonable number of events during startup, so that a status aggregator gets the events for all instances. Then during normal operation, when we're done adding sources and no longer need to replay events, we don't have to remember every single event.

Link to tracking issue

Closes #11818

Testing

go test status_test.go -count 1000 -failfast still passes with many tries.

@TylerHelmuth TylerHelmuth requested a review from a team as a code owner December 9, 2024 16:06
Copy link

codecov bot commented Dec 9, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.62%. Comparing base (be406d3) to head (e36001e).
Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #11826   +/-   ##
=======================================
  Coverage   91.62%   91.62%           
=======================================
  Files         447      447           
  Lines       23729    23731    +2     
=======================================
+ Hits        21741    21743    +2     
  Misses       1613     1613           
  Partials      375      375           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@TylerHelmuth TylerHelmuth added the ready-to-merge Code review completed; ready to merge by maintainers label Dec 9, 2024
@mx-psi mx-psi enabled auto-merge December 18, 2024 16:50
@mx-psi
Copy link
Member

mx-psi commented Dec 18, 2024

@TylerHelmuth Ready to merge once you fix the merge conflicts

@mx-psi mx-psi added this pull request to the merge queue Dec 18, 2024
Merged via the queue into open-telemetry:main with commit 0b88b76 Dec 18, 2024
51 checks passed
@github-actions github-actions bot added this to the next release milestone Dec 18, 2024
HongChenTW pushed a commit to HongChenTW/opentelemetry-collector that referenced this pull request Dec 19, 2024
…atus count (open-telemetry#11826)

#### Description
Use a ring buffer to only remember the last 5 events. This ensures we
remember a reasonable number of events during startup, so that a status
aggregator gets the events for all instances. Then during normal
operation, when we're done adding sources and no longer need to replay
events, we don't have to remember every single event.

#### Link to tracking issue
Closes
open-telemetry#11818

#### Testing

`go test status_test.go -count 1000 -failfast` still passes with many
tries.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-to-merge Code review completed; ready to merge by maintainers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unnecessary high memory in sharedcomponent
4 participants