Repository navigation
python: assert the theoretical wall-samples rate in python_sample_count - #228
Merged
Merged
Conversation
|
taegyunkim
force-pushed
the
taegyun.kim/python-sample-count-ddtrace-4.16
branch
from
October 28, 2026 14:52
5ba8a9c to
5504f14
Compare
taegyunkim
marked this pull request as ready for review
October 28, 2026 15:48
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
KowalskiThomas
approved these changes
Oct 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Changes the expected
wall-samplesrate inpython_sample_count_3.12from 4000 ± 20% to 5000 ± 30% samples per second. The accepted range moves from 3200–4800/s to 3500–6500/s.5000/s is the theoretical rate: the sampler runs 100 times per second (
g_default_sampling_period_us = 10000), and each pass samples at most 50 tasks (defaultmax_tasks). The scenario now asserts that rate instead of a value picked from past runs.Motivation
The profiler now takes about 4700–4900 samples per second in this scenario. That is often above the old 4800/s limit, so the scenario fails about 22–23% over target:
It started failing in the nightly on 2026-10-17, the day after ddtrace 4.16.0 reached PyPI, and failed on 9 of the next 11 nightlies. It still fails now that the nightly installs dd-trace-py
main(#227): 2 of the 3 runs since #227 merged failed.Measured rates (samples ÷ profile duration):
mainReal runs stay below 5000/s, for example when the sampler thread wakes late on a busy host. The slowest runs reach about 3670/s, so the margin is 30%: ±20% around 5000 would set the floor at 4000/s and fail those runs. The cap of 6500/s is above what the sampler can produce, so it still catches over-counting of more than 30%.
Validation
mainbuild (run 40710242609 with the earlier 4500/s target measured 4489/s, inside the new range).go test -run TestSchemaValidationpasses.