Repository navigation
fix: asyncio task reports and running task - #57
Merged
Merged
Conversation
We fix how asyncio task data is read and written, and add support for the running task of a sample. Task time used to be attached to every sample's task tree, so the same report was counted again at every sample that followed. Task trees now only hold structure, and each task report is attached once to the sample it came with, together with the task's previous position. Task reports no longer carry time on the wire: they are delimited by their frame count, and the reader works out the time a task spends at a position from its thread's samples while it holds it without running (none in CPU mode). At the end of a stream, every live task gets a report with the time it has spent at its position since its last one. Tasks that are gone are now forgotten together with their waiter edges, a task's waiter set no longer merges with an earlier one across samples, a waiter of 0 empties it, and a waiter that isn't known no longer hides the tasks it awaits. MOJO_TASK_RUNNING gives the task a sample's thread was running at that sample, as AustinSample.running_task. The writer writes task reports as they were read and only the waiter edges that changed, and compressed task ids start at 1, 0 standing for no task.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #57 +/- ##
==========================================
+ Coverage 78.61% 79.14% +0.53%
==========================================
Files 20 20
Lines 1987 2057 +70
Branches 246 256 +10
==========================================
+ Hits 1562 1628 +66
- Misses 353 355 +2
- Partials 72 74 +2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
We fix how asyncio task data is read and written, and add support for the running task of a sample.
Task time used to be attached to every sample's task tree, so the same report was counted again at every sample that followed. Task trees now only hold structure, and each task report is attached once to the sample it came with, together with the task's previous position.
Task reports no longer carry time on the wire: they are delimited by their frame count, and the reader works out the time a task spends at a position from its thread's samples while it holds it without running (none in CPU mode). At the end of a stream, every live task gets a report with the time it has spent at its position since its last one.
Tasks that are gone are now forgotten together with their waiter edges, a task's waiter set no longer merges with an earlier one across samples, a waiter of 0 empties it, and a waiter that isn't known no longer hides the tasks it awaits.
MOJO_TASK_RUNNING gives the task a sample's thread was running at that sample, as AustinSample.running_task. The writer writes task reports as they were read and only the waiter edges that changed, and compressed task ids start at 1, 0 standing for no task.
Requirements for Adding, Changing, Fixing or Removing a Feature
Fill out the template below. Any pull request that does not include enough
information to be reviewed in a timely manner may be closed at the maintainers'
discretion.