-
-
Notifications
You must be signed in to change notification settings - Fork 153
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
feat(profiling): Add support for Profiling #479
Conversation
This is meant to exclude compilation of nix dependent code on windows
Codecov Report
@@ Coverage Diff @@
## master #479 +/- ##
==========================================
- Coverage 81.23% 79.51% -1.73%
==========================================
Files 74 76 +2
Lines 8846 9054 +208
==========================================
+ Hits 7186 7199 +13
- Misses 1660 1855 +195 |
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.
This looks promising. I scattered some suggestions around. Essentially I would love this to move into its own module, and have a fn start_profiling() -> Option<ProfileGuard>
, and maybe a fn stop_profiling(ProfileGuard) -> Profile (the envelope item)
as the two functions that you call from the performance
module.
* refactor into a profiling.rs module * remove lazy_Static and mut_static * replace mutex with AtomicBool * remove profiling feature from test
}) | ||
.collect(); | ||
|
||
samples.push(Sample { |
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.
You can also use a rep.data.keys().map(…).collect()
instead of the Vec::new
+ push
.
This PR adds support for the profiling feature.
For this first iteration we will stick to the design implementation of the mobile profilers (
Android
/iOS
) with one profile being linked to one transaction.enable_profiling
option to enable/disable profilingprofiles_sample_rate
option to further sample profiles with respect to the transactions. This is dependent ontraces_sample_rate
and the probability of a profile being collected is:traces_sample_rate * profiles_sample_rate