austin-python 2.3.0__tar.gz → 2.4.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (73) hide show
  1. {austin_python-2.3.0 → austin_python-2.4.0}/PKG-INFO +1 -1
  2. {austin_python-2.3.0 → austin_python-2.4.0}/austin/events.py +51 -17
  3. {austin_python-2.3.0 → austin_python-2.4.0}/austin/format/mojo.py +267 -112
  4. {austin_python-2.3.0 → austin_python-2.4.0}/austin/stats.py +12 -4
  5. {austin_python-2.3.0 → austin_python-2.4.0}/test/format/test_mojo.py +391 -40
  6. {austin_python-2.3.0 → austin_python-2.4.0}/test/stats/test_austin_stats.py +54 -0
  7. {austin_python-2.3.0 → austin_python-2.4.0}/.flake8 +0 -0
  8. {austin_python-2.3.0 → austin_python-2.4.0}/.gitignore +0 -0
  9. {austin_python-2.3.0 → austin_python-2.4.0}/.readthedocs.yml +0 -0
  10. {austin_python-2.3.0 → austin_python-2.4.0}/AUTHORS +0 -0
  11. {austin_python-2.3.0 → austin_python-2.4.0}/CODE-OF-CONDUCT.md +0 -0
  12. {austin_python-2.3.0 → austin_python-2.4.0}/CONTRIBUTING.md +0 -0
  13. {austin_python-2.3.0 → austin_python-2.4.0}/COPYING +0 -0
  14. {austin_python-2.3.0 → austin_python-2.4.0}/ISSUE_TEMPLATE.md +0 -0
  15. {austin_python-2.3.0 → austin_python-2.4.0}/LICENSE.md +0 -0
  16. {austin_python-2.3.0 → austin_python-2.4.0}/MANIFEST.in +0 -0
  17. {austin_python-2.3.0 → austin_python-2.4.0}/PULL_REQUEST_TEMPLATE.md +0 -0
  18. {austin_python-2.3.0 → austin_python-2.4.0}/README.md +0 -0
  19. {austin_python-2.3.0 → austin_python-2.4.0}/austin/__init__.py +0 -0
  20. {austin_python-2.3.0 → austin_python-2.4.0}/austin/aio.py +0 -0
  21. {austin_python-2.3.0 → austin_python-2.4.0}/austin/base.py +0 -0
  22. {austin_python-2.3.0 → austin_python-2.4.0}/austin/cli.py +0 -0
  23. {austin_python-2.3.0 → austin_python-2.4.0}/austin/config.py +0 -0
  24. {austin_python-2.3.0 → austin_python-2.4.0}/austin/errors.py +0 -0
  25. {austin_python-2.3.0 → austin_python-2.4.0}/austin/format/__init__.py +0 -0
  26. {austin_python-2.3.0 → austin_python-2.4.0}/austin/format/collapsed_stack.py +0 -0
  27. {austin_python-2.3.0 → austin_python-2.4.0}/austin/format/compress.py +0 -0
  28. {austin_python-2.3.0 → austin_python-2.4.0}/austin/format/mojo_compress.py +0 -0
  29. {austin_python-2.3.0 → austin_python-2.4.0}/austin/format/pprof/__init__.py +0 -0
  30. {austin_python-2.3.0 → austin_python-2.4.0}/austin/format/pprof/__main__.py +0 -0
  31. {austin_python-2.3.0 → austin_python-2.4.0}/austin/format/pprof/profile.proto +0 -0
  32. {austin_python-2.3.0 → austin_python-2.4.0}/austin/format/pprof/profile_pb2.py +0 -0
  33. {austin_python-2.3.0 → austin_python-2.4.0}/austin/format/speedscope.py +0 -0
  34. {austin_python-2.3.0 → austin_python-2.4.0}/austin/simple.py +0 -0
  35. {austin_python-2.3.0 → austin_python-2.4.0}/austin/threads.py +0 -0
  36. {austin_python-2.3.0 → austin_python-2.4.0}/austin/tools/diff.py +0 -0
  37. {austin_python-2.3.0 → austin_python-2.4.0}/austin/tools/mojodbg.py +0 -0
  38. {austin_python-2.3.0 → austin_python-2.4.0}/austin/tools/resolve.py +0 -0
  39. {austin_python-2.3.0 → austin_python-2.4.0}/pyproject.toml +0 -0
  40. {austin_python-2.3.0 → austin_python-2.4.0}/test/__init__.py +0 -0
  41. {austin_python-2.3.0 → austin_python-2.4.0}/test/conftest.py +0 -0
  42. {austin_python-2.3.0 → austin_python-2.4.0}/test/data/austin.json +0 -0
  43. {austin_python-2.3.0 → austin_python-2.4.0}/test/data/austin.out +0 -0
  44. {austin_python-2.3.0 → austin_python-2.4.0}/test/data/austin.pprof +0 -0
  45. {austin_python-2.3.0 → austin_python-2.4.0}/test/data/austinp.mojo +0 -0
  46. {austin_python-2.3.0 → austin_python-2.4.0}/test/data/austinp.resolved.mojo +0 -0
  47. {austin_python-2.3.0 → austin_python-2.4.0}/test/data/column.mojo +0 -0
  48. {austin_python-2.3.0 → austin_python-2.4.0}/test/data/column.py +0 -0
  49. {austin_python-2.3.0 → austin_python-2.4.0}/test/data/diff_a-b.austin +0 -0
  50. {austin_python-2.3.0 → austin_python-2.4.0}/test/data/diff_a.austin +0 -0
  51. {austin_python-2.3.0 → austin_python-2.4.0}/test/data/diff_b.austin +0 -0
  52. {austin_python-2.3.0 → austin_python-2.4.0}/test/data/mp.austin +0 -0
  53. {austin_python-2.3.0 → austin_python-2.4.0}/test/data/mp.mojo +0 -0
  54. {austin_python-2.3.0 → austin_python-2.4.0}/test/data/repeat.austin +0 -0
  55. {austin_python-2.3.0 → austin_python-2.4.0}/test/data/repeat.mojo +0 -0
  56. {austin_python-2.3.0 → austin_python-2.4.0}/test/data/test.austin +0 -0
  57. {austin_python-2.3.0 → austin_python-2.4.0}/test/data/test.mojo +0 -0
  58. {austin_python-2.3.0 → austin_python-2.4.0}/test/format/__init__.py +0 -0
  59. {austin_python-2.3.0 → austin_python-2.4.0}/test/format/test_compress.py +0 -0
  60. {austin_python-2.3.0 → austin_python-2.4.0}/test/format/test_mojo_compress.py +0 -0
  61. {austin_python-2.3.0 → austin_python-2.4.0}/test/format/test_pprof.py +0 -0
  62. {austin_python-2.3.0 → austin_python-2.4.0}/test/format/test_speedscope.py +0 -0
  63. {austin_python-2.3.0 → austin_python-2.4.0}/test/stats/test_austin_file_reader.py +0 -0
  64. {austin_python-2.3.0 → austin_python-2.4.0}/test/stats/test_hierarchical_stats.py +0 -0
  65. {austin_python-2.3.0 → austin_python-2.4.0}/test/test_aio.py +0 -0
  66. {austin_python-2.3.0 → austin_python-2.4.0}/test/test_base.py +0 -0
  67. {austin_python-2.3.0 → austin_python-2.4.0}/test/test_cli.py +0 -0
  68. {austin_python-2.3.0 → austin_python-2.4.0}/test/test_config.py +0 -0
  69. {austin_python-2.3.0 → austin_python-2.4.0}/test/test_semver.py +0 -0
  70. {austin_python-2.3.0 → austin_python-2.4.0}/test/test_simple.py +0 -0
  71. {austin_python-2.3.0 → austin_python-2.4.0}/test/test_threads.py +0 -0
  72. {austin_python-2.3.0 → austin_python-2.4.0}/test/tools/test_diff.py +0 -0
  73. {austin_python-2.3.0 → austin_python-2.4.0}/test/tools/test_resolve.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: austin-python
3
- Version: 2.3.0
3
+ Version: 2.4.0
4
4
  Summary: Python wrapper for Austin, the CPython frame stack sampler.
5
5
  Project-URL: homepage, https://github.com/P403n1x87/austin-python
6
6
  Project-URL: documentation, https://austin-python.readthedocs.io
@@ -47,31 +47,59 @@ class AustinMetadata(AustinEvent):
47
47
  class AustinTask:
48
48
  """A node in an asyncio task tree (3.14+ only).
49
49
 
50
- ``frames`` is this task's own last-known suspended coroutine-chain
51
- snapshot -- empty if it was never captured suspended (e.g. it was only
52
- ever seen actively running rather than awaiting something). ``awaiting``
53
- are the tasks this task is itself awaiting, i.e. the tasks for which this
54
- task is the direct waiter.
55
-
56
- ``elapsed`` does NOT describe ``frames``. Austin only re-samples a task's
57
- chain (and reports a new node) when its identity has actually changed
58
- since the last scan, so the two are always one step apart: ``frames`` is
59
- the task's brand new position (just captured because it changed), while
60
- ``elapsed`` is how long the task dwelled at its *previous*, now-replaced
61
- position -- the earliest point at which that duration could be known at
62
- all. None on a task's first-ever sighting, when there is no previous
63
- position to report a duration for. Always a wall/CPU time value, or None
64
- if Austin was run in pure memory mode (no per-task memory delta exists to
65
- report -- see austin's own py_proc.c, _py_proc__maybe_discover_asyncio).
50
+ ``frames`` is this task's last-known position: its coroutine chain if it
51
+ was suspended, or the frames it was running if it was running.
52
+ ``awaiting`` are the tasks this task is itself awaiting, i.e. the tasks
53
+ for which this task is the direct waiter.
54
+
55
+ This is the structure of the tree only. The time tasks spend at their
56
+ positions is carried by AustinTaskReport (see AustinSample.task_reports)
57
+ and, while they are running, by the samples they are running at (see
58
+ AustinSample.running_task).
66
59
  """
67
60
 
68
61
  task_id: int
69
62
  name: t.Optional[str]
70
63
  frames: t.Tuple[AustinFrame, ...] = ()
71
- elapsed: t.Optional[MicroSeconds] = None
72
64
  awaiting: t.Tuple["AustinTask", ...] = ()
73
65
 
74
66
 
67
+ @dataclass(frozen=True)
68
+ class AustinTaskReport:
69
+ """A report of a task's position (3.14+ only).
70
+
71
+ Austin only reports a task's position when it has changed. ``frames`` is
72
+ the task's new position, and ``elapsed`` is how long the task was
73
+ *suspended* at its ``previous`` one, which this report replaces -- the
74
+ earliest point at which that duration could be known at all. Austin
75
+ doesn't report it: readers work it out as the time of the task's thread's
76
+ samples while the task held that position without running. It is await
77
+ time only: the time a task spends running is the time of the samples it
78
+ is running at (see AustinSample.running_task). Always 0 in CPU mode, where
79
+ a suspended task uses no CPU.
80
+
81
+ ``previous`` is None on a task's first report, which has no previous
82
+ position (and so ``elapsed`` is 0). A report with no ``frames`` closes the
83
+ task: it is gone, and ``elapsed`` is the time at its last position. At the
84
+ end of a stream, each task still alive gets a report with ``frames`` equal
85
+ to ``previous``, carrying the time it has spent at its position since.
86
+
87
+ Each report is attached to exactly one sample, so summing ``elapsed``
88
+ over every sample's reports counts each duration once.
89
+ """
90
+
91
+ task_id: int
92
+ name: t.Optional[str]
93
+ frames: t.Tuple[AustinFrame, ...]
94
+ previous: t.Optional[t.Tuple[AustinFrame, ...]]
95
+ elapsed: MicroSeconds
96
+
97
+ @property
98
+ def closing(self) -> bool:
99
+ """Whether this report closes the task."""
100
+ return not self.frames
101
+
102
+
75
103
  @dataclass(frozen=True)
76
104
  class AustinSample(AustinEvent):
77
105
  """Austin sample."""
@@ -92,7 +120,13 @@ class AustinSample(AustinEvent):
92
120
  frames: t.Optional[t.Tuple[AustinFrame, ...]] = None
93
121
  gc: t.Optional[bool] = None
94
122
  idle: t.Optional[bool] = None
123
+ # The live tasks owned by this sample's thread, as of this sample.
95
124
  tasks: t.Tuple[AustinTask, ...] = ()
125
+ # The task reports that came with this sample, each one exactly once.
126
+ task_reports: t.Tuple[AustinTaskReport, ...] = ()
127
+ # The task this sample's thread was running, if any. The sample's metrics
128
+ # then belong to that task too, at its latest position (see AustinTask).
129
+ running_task: t.Optional[int] = None
96
130
 
97
131
  def key(
98
132
  self,