Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions scenarios/python_sample_count_3.12/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@ All coroutines are gathered in a single `asyncio.run` call.

- **Task reservoir**: by default, the profiler samples at most 50 leaf tasks per cycle.
This scenario intentionally exercises that default behavior.
- **wall-samples**: the total number of raw stack samples captured over the run is checked
against a reference value (`value-matching-sum` = 4000) with a wide error margin (20%).
Reservoir sampling reduces the prior count by approximately `50 / 500`; host scheduling
noise still makes this a coarse regression check rather than an exact count.
- **wall-samples**: the number of raw stack samples per second of profile
(`scale_by_duration`) is checked against the theoretical rate (`value-matching-sum` = 5000):
100 sampling cycles per second (10 ms default interval) times 50 reservoir tasks.
Real runs land below it, for example when the sampler thread wakes late on a busy host.
The error margin is wide (30%, so 3500 to 6500 per second): CI measured 3667 to 4931 per
second with ddtrace 4.15.x, 4.16.0 and dd-trace-py `main`. This is a coarse check that
catches a sampler running far too often or too rarely.
4 changes: 2 additions & 2 deletions scenarios/python_sample_count_3.12/expected_profile.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
"regular_expression": ".*"
}
],
"value-matching-sum": 4000,
"error-margin": 20
"value-matching-sum": 5000,
"error-margin": 30
}
],
"scale_by_duration": true
Expand Down
Loading