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

Extract thread control logic into a new ThreadedPeriodicWorker class #2304

Merged
merged 1 commit into from
May 2, 2024

Conversation

st0012
Copy link
Collaborator

@st0012 st0012 commented May 1, 2024

Instead of letting BackpressureMonitor, SessionFlusher, and Metrics::Aggregator handle their own threading logic, we can extract that into a new class that can be reused by all of them.

Closes #2261

#skip-changelog

@st0012 st0012 requested a review from sl0thentr0py May 1, 2024 22:20
Copy link

codecov bot commented May 1, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.73%. Comparing base (6cdb1fc) to head (309661e).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2304      +/-   ##
==========================================
+ Coverage   98.72%   98.73%   +0.01%     
==========================================
  Files         202      203       +1     
  Lines       13301    13274      -27     
==========================================
- Hits        13131    13106      -25     
+ Misses        170      168       -2     
Components Coverage Δ
sentry-ruby 99.12% <100.00%> (+0.01%) ⬆️
sentry-rails 97.37% <ø> (ø)
sentry-sidekiq 96.98% <ø> (ø)
sentry-resque 96.76% <ø> (ø)
sentry-delayed_job 98.91% <ø> (ø)
sentry-opentelemetry 100.00% <ø> (ø)
Files Coverage Δ
sentry-ruby/lib/sentry-ruby.rb 96.58% <100.00%> (+0.01%) ⬆️
sentry-ruby/lib/sentry/backpressure_monitor.rb 100.00% <100.00%> (+2.27%) ⬆️
sentry-ruby/lib/sentry/metrics/aggregator.rb 100.00% <100.00%> (ø)
sentry-ruby/lib/sentry/session_flusher.rb 100.00% <100.00%> (+2.00%) ⬆️
sentry-ruby/lib/sentry/threaded_periodic_worker.rb 100.00% <100.00%> (ø)
...ntry-ruby/spec/sentry/backpressure_monitor_spec.rb 100.00% <100.00%> (ø)
sentry-ruby/spec/sentry/metrics/aggregator_spec.rb 100.00% <100.00%> (ø)
sentry-ruby/spec/sentry/session_flusher_spec.rb 100.00% <100.00%> (ø)

@st0012 st0012 marked this pull request as draft May 2, 2024 10:53
Instead of letting BackpressureMonitor, SessionFlusher, and Metrics::Aggregator
handle their own threading logic, we can extract that into a new class
that can be reused by all of them.
@st0012 st0012 marked this pull request as ready for review May 2, 2024 10:59
Copy link
Member

@sl0thentr0py sl0thentr0py left a comment

Choose a reason for hiding this comment

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

ty! <3

@sl0thentr0py sl0thentr0py merged commit 09fa602 into master May 2, 2024
125 checks passed
@sl0thentr0py sl0thentr0py deleted the implement-#2261 branch May 2, 2024 11:27
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.

Unify threading logic under a base class/module
2 participants