Skip to content

Commit 8a05d1e

Browse files
committed
docs: use new art
Also fixed a minor regression and linting errors.
1 parent e0819b7 commit 8a05d1e

10 files changed

+37
-2
lines changed

README.md

+28
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,15 @@ will be able to navigate through them with the arrow keys.
118118
> [linked](https://pip.pypa.io/en/latest/user_guide/#installing-from-wheels)
119119
> page.
120120
121+
## Thread navigation
122+
123+
Profiling data is processed on a per-thread basis. The total number of threads
124+
(across all processes, if sampling child processes) is displayed in the
125+
top-right corner of the TUI. To navigate to a different thread, use the
126+
<kbd>&larr;</kbd> and <kbd>&rarr;</kbd> arrows. The PID and TID of the currently
127+
selected thread will appear in the middle of the top bar in the TUI.
128+
129+
121130
## Full mode
122131

123132
By default, Austin TUI shows you statistics of the last seen stack for each
@@ -164,13 +173,31 @@ operation on the bottom-right corner.
164173
alt="Austin TUI - Save notification" />
165174
</p>
166175

176+
If you run the Austin TUI inside VS Code, you can benefit from the editor's
177+
terminal features, like using <kbd>Ctrl</kbd>/<kbd>Cmd</kbd>+<kbd>Left-Click</kbd>
178+
to hop straight into a source file at a given line. You can also leverage the
179+
TUI's save feature to export the collected samples and import them into the
180+
[Austin VS Code] extension to also get a flame graph representation.
181+
182+
<p align="center">
183+
<img src="art/austin-tui-vscode.gif"
184+
style="box-shadow: #111 0px 0px 16px;"
185+
alt="Austin TUI" />
186+
</p>
167187

168188
## Threshold
169189

170190
The statistics reported by the TUI might be overwhelming, especially in full
171191
mode. To reduce the amout of data that gets displayed, the keys <kbd>+</kbd> and
172192
<kbd>-</kbd> can be used to increase or lower the `%TOTAL` threshold
173193

194+
<p align="center">
195+
<img src="art/austin-tui-threshold.png"
196+
style="box-shadow: #111 0px 0px 16px;"
197+
alt="Austin TUI - Threshold demonstration" />
198+
</p>
199+
200+
174201
# Compatibility
175202

176203
Austin TUI has been tested with Python 3.6-3.10 and is known to work on
@@ -218,4 +245,5 @@ on BMC or by chipping in a few pennies on
218245
[Austin]: https://github.com/P403n1x87/austin
219246
[austin-python]: https://github.com/P403n1x87/austin-python#installation
220247
[Austin installation]: https://github.com/P403n1x87/austin#installation
248+
[Austin VS Code]: https://marketplace.visualstudio.com/items?itemName=p403n1x87.austin-vscode
221249
[The Austin TUI Way to Resourceful Text-based User Interfaces]: https://p403n1x87.github.io/the-austin-tui-way-to-resourceful-text-based-user-interfaces.html

art/austin-tui-full-mode.png

-367 KB
Loading

art/austin-tui-normal-mode.png

-382 KB
Loading

art/austin-tui-save.png

-364 KB
Loading

art/austin-tui-threshold.png

77.4 KB
Loading

art/austin-tui-vscode.gif

1.2 MB
Loading

art/austin-tui.gif

-747 KB
Loading

austin_tui/view/austin.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -105,11 +105,13 @@ async def on_table_pgdown(self, data: Any = None) -> bool:
105105
return False
106106

107107
async def on_table_home(self, _: Any = None) -> bool:
108+
"""Handle Home key on the table widget."""
108109
self.stats_view.top()
109110
self.stats_view.refresh()
110111
return False
111112

112113
async def on_table_end(self, _: Any = None) -> bool:
114+
"""Handle End key on the table widget."""
113115
self.stats_view.bottom()
114116
self.stats_view.refresh()
115117
return False
@@ -211,5 +213,5 @@ def set_pid(self, pid: int, children: bool) -> None:
211213
self.pid.set_text(self.markup(f"<pid><b>{pid}</b></pid>"))
212214

213215
def set_python(self, version: str) -> None:
214-
"""Set the Python version"""
216+
"""Set the Python version."""
215217
self.python.set_text(".".join([str(_) for _ in version]))

austin_tui/widgets/label.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,10 @@ def draw(self) -> bool:
128128
return False
129129

130130
if isinstance(self.text, AttrString):
131-
win.addstr(self.y, self.x, " " * width, self.attr)
131+
try:
132+
win.addstr(self.y, self.x, " " * width, self.attr)
133+
except curses.error:
134+
pass
132135
x = self.x
133136
if self.align == TextAlign.RIGHT and len(self.text) < width:
134137
x += width - len(self.text)

austin_tui/widgets/scroll.py

+2
Original file line numberDiff line numberDiff line change
@@ -106,10 +106,12 @@ def scroll_up(self, lines: int = 1) -> None:
106106
self._draw_scroll_bar()
107107

108108
def top(self) -> None:
109+
"""Scroll to the top."""
109110
self.curr_y = 0
110111
self._draw_scroll_bar()
111112

112113
def bottom(self) -> None:
114+
"""Scroll to the bottom."""
113115
self.curr_y = self.h - self.height
114116
self._draw_scroll_bar()
115117

0 commit comments

Comments
 (0)