Commit 978d61a
Strip live_collector to its user-facing API surface
Guiding principle: stubs should only contain what users of the profiling
API would actually import or tab-complete. The live_collector subpackage
is primarily a TUI display component; its internal widget/display
architecture is not part of any user-facing API.
Judgement calls — removed:
- live_collector/widgets.pyi: deleted — Widget, ProgressBarWidget,
HeaderWidget, TableWidget, FooterWidget, HelpWidget, OpcodePanel are
internal TUI rendering components; nobody writing code against the
profiling API would import them
- live_collector/trend_tracker.pyi: deleted — TrendTracker is an internal
widget state helper used only inside the TUI rendering loop
- live_collector/constants.pyi: deleted — TUI layout dimensions and curses
color pair IDs (COLOR_PAIR_*, WIDTH_THRESHOLD_*, MIN_TERMINAL_*, etc.)
have no meaning outside the live_collector implementation
- live_collector/display.pyi: removed CursesDisplay (internal curses
wrapper) and MockDisplay (test helper only referenced in tests, not
production API); kept DisplayInterface because it is the type of the
display= parameter on LiveStatsCollector.__init__
- live_collector/collector.pyi: removed all constant imports (COLOR_PAIR_*,
MICROSECONDS_PER_SECOND, MIN_TERMINAL_*, etc.) that were leaked
implementation imports not used in any type annotations; removed widget
imports (HeaderWidget, TableWidget, etc.) and TrendTracker; removed
ThreadData dataclass (internal per-sample accumulator); stripped
LiveStatsCollector of TUI-state attributes (stdscr, selected_row,
scroll_offset, paused, show_help, filter_*, view_mode,
current_thread_index, per_thread_data, *_widget, display_update_interval_sec,
thread_status_counts, gc_frame_samples, opcode_stats) and internal
methods (simplify_path, process_frames, init_curses, cleanup_curses)
- live_collector/__init__.pyi: stripped __all__ and re-exports to just
LiveStatsCollector and DisplayInterface
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent 5816e2d commit 978d61a
File tree
6 files changed
+10
-290
lines changed- stdlib/profiling/sampling/live_collector
6 files changed
+10
-290
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
3 | | - | |
4 | | - | |
5 | | - | |
6 | | - | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | | - | |
| 2 | + | |
11 | 3 | | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
| 4 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | 1 | | |
3 | | - | |
4 | 2 | | |
5 | 3 | | |
6 | | - | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
| 4 | + | |
| 5 | + | |
64 | 6 | | |
65 | 7 | | |
66 | 8 | | |
| |||
70 | 12 | | |
71 | 13 | | |
72 | 14 | | |
| 15 | + | |
| 16 | + | |
73 | 17 | | |
74 | | - | |
75 | | - | |
76 | 18 | | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
77 | 22 | | |
78 | 23 | | |
79 | 24 | | |
80 | 25 | | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
| 26 | + | |
98 | 27 | | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | 28 | | |
108 | 29 | | |
109 | 30 | | |
| |||
121 | 42 | | |
122 | 43 | | |
123 | 44 | | |
124 | | - | |
125 | | - | |
126 | 45 | | |
127 | 46 | | |
128 | 47 | | |
129 | 48 | | |
130 | 49 | | |
131 | | - | |
132 | | - | |
133 | 50 | | |
This file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
3 | 2 | | |
4 | 3 | | |
5 | 4 | | |
| |||
25 | 24 | | |
26 | 25 | | |
27 | 26 | | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
Lines changed: 0 additions & 17 deletions
This file was deleted.
This file was deleted.
0 commit comments