-
Notifications
You must be signed in to change notification settings - Fork 76
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
Add sampler profiling #623
Conversation
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.
Thanks for this PR!
Something about your changes seems to break CI (it was running successfully on the default branch this morning). Could you please take a look?
@janjagusch @AndreasAlbertQC a few options
|
You mean in this file? I don't have a strong preference. What about adding the section but setting it to
I'm unsure how easily we could integrate this in the current testing suite. If it's too much work, then I suggest we leave it untested for now. Let's do a manual demonstration together, so I can see that it's working. |
Codecov ReportPatch coverage:
📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more Additional details and impacted files@@ Coverage Diff @@
## main #623 +/- ##
==========================================
- Coverage 82.28% 81.45% -0.84%
==========================================
Files 78 78
Lines 6124 6135 +11
==========================================
- Hits 5039 4997 -42
- Misses 1085 1138 +53
☔ View full report in Codecov by Sentry. |
Indeed that file. Sure, I can change it to false.
That's why I suggested just going for manual QA only. I could see how to write a test that if profiling is enabled and the query parameter is given, the response is an HTML page instead of a JSON answer (probably via the content-type of the response). But this sounds like a very weak test. |
True, but still better than no test, though. At least it will break if something in the setup changes (e.g. some unexpected breaking change in pyinstrument). |
I'm also in favor of this smoke test. After that, we should be good to merge. |
This PR leverages
pyinstrument
to provide sampling profiling to all endpoints exposed byquetz
.For this to happen, the
enable_sampling
configuration of the sectionprofiling
must be set toTrue
and then addingprofiling=true
(or any value that evaluates toTrue
) as a query parameter. Once this is done, the response will not be the expected one, but an HTML view of the profiling done bypyinstrument
.