-
Notifications
You must be signed in to change notification settings - Fork 470
feat(profiling): profile asyncio.Condition primitives with Python Lock profiler #15550
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
base: main
Are you sure you want to change the base?
Conversation
|
|
Bootstrap import analysisComparison of import times between this PR and base. SummaryThe average import time from this PR is: 251 ± 3 ms. The average import time from base is: 254 ± 2 ms. The import time difference between this PR and base is: -3.3 ± 0.1 ms. Import time breakdownThe following import paths have shrunk:
|
57f1703 to
f333100
Compare
…hon Lock profiler
f333100 to
79bceeb
Compare
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.
These release notes can all be combined into one file
https://datadoghq.atlassian.net/browse/PROF-12724
note
this PR implements profiling the time to acquire
Condition's underlying lock. While this data is somewhat useful on its own (more contention data better than less?), it would be more valuable to profile how long a Condition was waited on before signaling, etc. This would requireddupAPI changes, and new backend/UI work to display the new data type. As such, this rich implementation will be pushed to Q1 (?) 2026.end note
Description
Adds profiling support for
asyncio.Conditionto the Python Lock profiler. This extends the lock profiling capability to include condition variables in asynchronous applications.Motivation
asyncio.Conditionis a synchronization primitive that allows tasks to wait for a specific condition. Profiling Condition usage helps identify:Changes
AsyncioConditionCollectorinddtrace/profiling/collector/asyncio.py.asyncio.Conditionalso creates an internalasyncio.Lock, and since we now have a handful of lock types following the same pattern, theis_internallogic was generalized by adding aINTERNAL_MODULE_FILEclass attribute toLockCollector.Testing
TestAsyncioConditionCollectorwithtest_condition_wait_notifytestBaseAsyncioLockCollectorTest