-
-
Notifications
You must be signed in to change notification settings - Fork 493
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
Experimental support for multi-threaded profiling using Vernier #2372
base: master
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #2372 +/- ##
==========================================
- Coverage 98.68% 98.65% -0.03%
==========================================
Files 210 217 +7
Lines 13957 14307 +350
==========================================
+ Hits 13773 14115 +342
- Misses 184 192 +8
|
3d995d8
to
b45c7f3
Compare
5220e97
to
bd687cc
Compare
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.
amazing work @solnic
did a first pass, some questions and comments
will do a detailed test round later in the week
@started = false | ||
@sampled = nil | ||
|
||
@profiling_enabled = defined?(Vernier) && configuration.profiling_enabled? |
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.
Is it possible for this part being loaded but Vernier
is still not defined?
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.
@st0012 yes, we rescue from LoadError if vernier is not bundled. It's the same with stackprof, its Profiler gets required even if stackprof is not available (see transaction.rb). I think we can make this whole conditional code loading better in the future and limit the amount of files that sentry requires. ie we can have some API for configuring features and then based on its configuration a smart code loader would know what to do.
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.
I think we can return
in the rescue block then we won't need to call defined?
at all. For example:
begin
require "foo"
rescue LoadError
return
end
Foo.bar
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.
sorry to come back to this, but can we keep both similar? Right now stackprof has one way and vernier has another.
579dfef
to
babc6ed
Compare
@sl0thentr0py @st0012 thanks for the comments! There are a couple of things that need be fixed. I'll ping you once it's done next week. |
6cc823c
to
3a9367b
Compare
4d2785b
to
dd7fdf9
Compare
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.
Left another comment wrt the defined?
check. But otherwise looks good to me 👍
b22bd63
to
97e21ac
Compare
2f31b55
to
79c8e62
Compare
@solnic we're not requiring the new I would also prefer a warning message in |
I tried on a simple rails controller with some database calls and the profile is not sent due to being oversized. |
1b9f47a
to
6ca6041
Compare
@sl0thentr0py OK I made it so that sentry/vernier/profiler is required automatically and if you try to set it in the config when vernier is not available, then you'll get a meaningful error message:
|
@sl0thentr0py wdym by "this logic" exactly? |
6ca6041
to
3417545
Compare
Seems like StackProf.results is leaking between specs when it's stubbed via `allow`, so we gotta restub it in the profiler spec too.
- Introduce `Sentry::Vernier::Profiler` - Introduce `Sentry.config.profiler` that can be set to a class that should be used for profiling. By default it's set to `Sentry::Profiler`
3417545
to
282c3c2
Compare
we need to generalize this logic to have different limits according to different envelope |
Experimental support for Vernier.
Screenshots