diff --git a/scenarios/python_sample_count_3.12/README.md b/scenarios/python_sample_count_3.12/README.md index dbcfc833..3c4dca0b 100644 --- a/scenarios/python_sample_count_3.12/README.md +++ b/scenarios/python_sample_count_3.12/README.md @@ -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. diff --git a/scenarios/python_sample_count_3.12/expected_profile.json b/scenarios/python_sample_count_3.12/expected_profile.json index 65e09b84..1ab08985 100644 --- a/scenarios/python_sample_count_3.12/expected_profile.json +++ b/scenarios/python_sample_count_3.12/expected_profile.json @@ -8,8 +8,8 @@ "regular_expression": ".*" } ], - "value-matching-sum": 4000, - "error-margin": 20 + "value-matching-sum": 5000, + "error-margin": 30 } ], "scale_by_duration": true