macpm 3.2.0__tar.gz → 3.3.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.
- {macpm-3.2.0 → macpm-3.3.0}/CHANGELOG.md +42 -0
- {macpm-3.2.0/macpm.egg-info → macpm-3.3.0}/PKG-INFO +47 -4
- {macpm-3.2.0 → macpm-3.3.0}/README.md +46 -3
- {macpm-3.2.0 → macpm-3.3.0}/RELEASE.md +14 -14
- {macpm-3.2.0 → macpm-3.3.0}/macpm/__init__.py +1 -1
- {macpm-3.2.0 → macpm-3.3.0}/macpm/blessed_engine.py +65 -23
- {macpm-3.2.0 → macpm-3.3.0}/macpm/footprint.py +14 -2
- {macpm-3.2.0 → macpm-3.3.0}/macpm/gpuview.py +246 -38
- {macpm-3.2.0 → macpm-3.3.0}/macpm/macpm.py +105 -16
- {macpm-3.2.0 → macpm-3.3.0}/macpm/network.py +148 -3
- {macpm-3.2.0 → macpm-3.3.0}/macpm/processes.py +101 -23
- {macpm-3.2.0 → macpm-3.3.0}/macpm/sensors.py +47 -0
- macpm-3.3.0/macpm/theme.py +286 -0
- {macpm-3.2.0 → macpm-3.3.0}/macpm/widgets.py +6 -0
- {macpm-3.2.0 → macpm-3.3.0/macpm.egg-info}/PKG-INFO +47 -4
- {macpm-3.2.0 → macpm-3.3.0}/macpm.egg-info/SOURCES.txt +2 -0
- {macpm-3.2.0 → macpm-3.3.0}/setup.py +1 -1
- {macpm-3.2.0 → macpm-3.3.0}/tests/test_footprint.py +30 -0
- {macpm-3.2.0 → macpm-3.3.0}/tests/test_gpuview.py +113 -0
- {macpm-3.2.0 → macpm-3.3.0}/tests/test_sampler_macos.py +19 -0
- macpm-3.3.0/tests/test_theme.py +185 -0
- {macpm-3.2.0 → macpm-3.3.0}/LICENSE +0 -0
- {macpm-3.2.0 → macpm-3.3.0}/MANIFEST.in +0 -0
- {macpm-3.2.0 → macpm-3.3.0}/docs/linux-port.md +0 -0
- {macpm-3.2.0 → macpm-3.3.0}/macpm/__main__.py +0 -0
- {macpm-3.2.0 → macpm-3.3.0}/macpm/backend.py +0 -0
- {macpm-3.2.0 → macpm-3.3.0}/macpm/capabilities.py +0 -0
- {macpm-3.2.0 → macpm-3.3.0}/macpm/dump.py +0 -0
- {macpm-3.2.0 → macpm-3.3.0}/macpm/ioreport.py +0 -0
- {macpm-3.2.0 → macpm-3.3.0}/macpm/linux_backend/__init__.py +0 -0
- {macpm-3.2.0 → macpm-3.3.0}/macpm/linux_backend/cpu.py +0 -0
- {macpm-3.2.0 → macpm-3.3.0}/macpm/linux_backend/gpu.py +0 -0
- {macpm-3.2.0 → macpm-3.3.0}/macpm/linux_backend/modelname.py +0 -0
- {macpm-3.2.0 → macpm-3.3.0}/macpm/linux_backend/net.py +0 -0
- {macpm-3.2.0 → macpm-3.3.0}/macpm/linux_backend/power.py +0 -0
- {macpm-3.2.0 → macpm-3.3.0}/macpm/linux_backend/proc.py +0 -0
- {macpm-3.2.0 → macpm-3.3.0}/macpm/linux_backend/sampler.py +0 -0
- {macpm-3.2.0 → macpm-3.3.0}/macpm/linux_backend/soc.py +0 -0
- {macpm-3.2.0 → macpm-3.3.0}/macpm/linux_backend/sysfs.py +0 -0
- {macpm-3.2.0 → macpm-3.3.0}/macpm/linux_backend/thermal.py +0 -0
- {macpm-3.2.0 → macpm-3.3.0}/macpm/macos_gpu.py +0 -0
- {macpm-3.2.0 → macpm-3.3.0}/macpm/metrics.py +0 -0
- {macpm-3.2.0 → macpm-3.3.0}/macpm/netinfo.py +0 -0
- {macpm-3.2.0 → macpm-3.3.0}/macpm/netmodel.py +0 -0
- {macpm-3.2.0 → macpm-3.3.0}/macpm/probe.py +0 -0
- {macpm-3.2.0 → macpm-3.3.0}/macpm/sampler.py +0 -0
- {macpm-3.2.0 → macpm-3.3.0}/macpm/smc.py +0 -0
- {macpm-3.2.0 → macpm-3.3.0}/macpm/soc.py +0 -0
- {macpm-3.2.0 → macpm-3.3.0}/macpm/tui.py +0 -0
- {macpm-3.2.0 → macpm-3.3.0}/macpm.egg-info/dependency_links.txt +0 -0
- {macpm-3.2.0 → macpm-3.3.0}/macpm.egg-info/entry_points.txt +0 -0
- {macpm-3.2.0 → macpm-3.3.0}/macpm.egg-info/not-zip-safe +0 -0
- {macpm-3.2.0 → macpm-3.3.0}/macpm.egg-info/requires.txt +0 -0
- {macpm-3.2.0 → macpm-3.3.0}/macpm.egg-info/top_level.txt +0 -0
- {macpm-3.2.0 → macpm-3.3.0}/packaging/README-linux.txt +0 -0
- {macpm-3.2.0 → macpm-3.3.0}/packaging/README.txt +0 -0
- {macpm-3.2.0 → macpm-3.3.0}/packaging/build-linux.sh +0 -0
- {macpm-3.2.0 → macpm-3.3.0}/packaging/build.sh +0 -0
- {macpm-3.2.0 → macpm-3.3.0}/packaging/entry_tui.py +0 -0
- {macpm-3.2.0 → macpm-3.3.0}/packaging/install.sh +0 -0
- {macpm-3.2.0 → macpm-3.3.0}/packaging/linux/Dockerfile +0 -0
- {macpm-3.2.0 → macpm-3.3.0}/packaging/linux/README.txt +0 -0
- {macpm-3.2.0 → macpm-3.3.0}/packaging/macpm-linux.spec +0 -0
- {macpm-3.2.0 → macpm-3.3.0}/packaging/macpm.command +0 -0
- {macpm-3.2.0 → macpm-3.3.0}/pyproject.toml +0 -0
- {macpm-3.2.0 → macpm-3.3.0}/setup.cfg +0 -0
- {macpm-3.2.0 → macpm-3.3.0}/tests/__init__.py +0 -0
- {macpm-3.2.0 → macpm-3.3.0}/tests/linux_fixtures.py +0 -0
- {macpm-3.2.0 → macpm-3.3.0}/tests/test_ane.py +0 -0
- {macpm-3.2.0 → macpm-3.3.0}/tests/test_blessed_engine.py +0 -0
- {macpm-3.2.0 → macpm-3.3.0}/tests/test_calc_freq.py +0 -0
- {macpm-3.2.0 → macpm-3.3.0}/tests/test_cli.py +0 -0
- {macpm-3.2.0 → macpm-3.3.0}/tests/test_layout.py +0 -0
- {macpm-3.2.0 → macpm-3.3.0}/tests/test_linux_cpu.py +0 -0
- {macpm-3.2.0 → macpm-3.3.0}/tests/test_linux_gpu.py +0 -0
- {macpm-3.2.0 → macpm-3.3.0}/tests/test_linux_ixsmi.py +0 -0
- {macpm-3.2.0 → macpm-3.3.0}/tests/test_linux_modelname.py +0 -0
- {macpm-3.2.0 → macpm-3.3.0}/tests/test_linux_net.py +0 -0
- {macpm-3.2.0 → macpm-3.3.0}/tests/test_linux_nvidia.py +0 -0
- {macpm-3.2.0 → macpm-3.3.0}/tests/test_linux_power.py +0 -0
- {macpm-3.2.0 → macpm-3.3.0}/tests/test_linux_sampler.py +0 -0
- {macpm-3.2.0 → macpm-3.3.0}/tests/test_linux_thermal.py +0 -0
- {macpm-3.2.0 → macpm-3.3.0}/tests/test_linux_view.py +0 -0
- {macpm-3.2.0 → macpm-3.3.0}/tests/test_linux_wiring.py +0 -0
- {macpm-3.2.0 → macpm-3.3.0}/tests/test_macos_gpu.py +0 -0
- {macpm-3.2.0 → macpm-3.3.0}/tests/test_netinfo.py +0 -0
- {macpm-3.2.0 → macpm-3.3.0}/tests/test_network.py +0 -0
- {macpm-3.2.0 → macpm-3.3.0}/tests/test_probe.py +0 -0
- {macpm-3.2.0 → macpm-3.3.0}/tests/test_process_linux.py +0 -0
- {macpm-3.2.0 → macpm-3.3.0}/tests/test_processes.py +0 -0
- {macpm-3.2.0 → macpm-3.3.0}/tests/test_sampler.py +0 -0
- {macpm-3.2.0 → macpm-3.3.0}/tests/test_sensors.py +0 -0
- {macpm-3.2.0 → macpm-3.3.0}/tests/test_widgets.py +0 -0
|
@@ -1,5 +1,47 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 3.3.0 — 2026-11-20
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
|
|
7
|
+
- A ninth colour stop, the built-in semantic theme (`--native`, or `→` from
|
|
8
|
+
`8`): grey frame, bright-white machine title and numbers, brown category box
|
|
9
|
+
names, near-white field names, dim secondary text, blue IO rates, cyan IP
|
|
10
|
+
addresses, green normal bars, yellow footer key hints, and amber/red only for
|
|
11
|
+
warnings. Gauges and temperatures use green/amber/red at 60/85% load,
|
|
12
|
+
75/90°C, 75/90% RAM, 50/80% process CPU and 5/15% process memory. The palette
|
|
13
|
+
uses fixed xterm-256 indices (16-255), so it does not follow the terminal.
|
|
14
|
+
- Table lists only keep the header row and the current sort column bright; all
|
|
15
|
+
other normal cells are dim. This applies to the process view, the network
|
|
16
|
+
traffic/listener tables and the single-card GPU process table, and fits the
|
|
17
|
+
brown titles, blue rates, cyan addresses and yellow footer keys throughout.
|
|
18
|
+
- GPU card `BUSY`/`VRAM` bars use the same green/amber/red thresholds instead of
|
|
19
|
+
being uncoloured; `GPU INFO`, `GPUs (N)` and the per-card headers follow the
|
|
20
|
+
same title/header roles.
|
|
21
|
+
- `--no-color` remains a startup-only monochrome mode outside the ring.
|
|
22
|
+
- `images/native.png`: the semantic palette screenshot used in the README.
|
|
23
|
+
|
|
24
|
+
### Changed
|
|
25
|
+
|
|
26
|
+
- macOS GPU view: a process stays listed while it holds GPU memory, even when
|
|
27
|
+
its `GPU%` is momentarily 0 (a browser between frames), instead of flickering
|
|
28
|
+
in and out of the table. The `CARD` column is hidden on macOS, where a
|
|
29
|
+
single integrated GPU would make every row read `-`.
|
|
30
|
+
- The macOS `footprint` poller now targets only processes that actually hold a
|
|
31
|
+
Metal client (from the IORegistry), and rotates the idle targets beyond its
|
|
32
|
+
32-target cap, so every GPU app is eventually measured instead of the
|
|
33
|
+
lowest-PID daemons taking the slots.
|
|
34
|
+
- A single-card GPU view no longer repeats that card's power in the box title;
|
|
35
|
+
the total stays on multi-GPU hosts, where each row is one card.
|
|
36
|
+
- Narrow terminals keep the card table's VRAM column: it first shrinks to a
|
|
37
|
+
short bar with compact numbers, then to numbers only, and is dropped only
|
|
38
|
+
below ~74 columns. Previously the whole column disappeared under 86
|
|
39
|
+
columns.
|
|
40
|
+
- The card table sizes `NAME` to the longest card plus padding instead of
|
|
41
|
+
letting it absorb the whole spare width; the surplus goes to the VRAM bar
|
|
42
|
+
(`BUSY` on tables too narrow for VRAM). `BUSY` is left-aligned so its bar
|
|
43
|
+
starts directly after the name.
|
|
44
|
+
|
|
3
45
|
## 3.2.0 — 2026-11-16
|
|
4
46
|
|
|
5
47
|
### Added
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: macpm
|
|
3
|
-
Version: 3.
|
|
3
|
+
Version: 3.3.0
|
|
4
4
|
Summary: Performance monitoring CLI for Apple Silicon and Linux
|
|
5
5
|
Home-page: https://github.com/visualcjy/macpm
|
|
6
6
|
Author: Jinyu Chen
|
|
@@ -52,6 +52,21 @@ A Python-based `nvtop`-inspired terminal monitor for Apple Silicon Macs,
|
|
|
52
52
|
forked from [asitop](https://github.com/tlkh/asitop), with an x86_64/arm64
|
|
53
53
|
Linux backend.
|
|
54
54
|
|
|
55
|
+
## What's new in 3.3
|
|
56
|
+
|
|
57
|
+
- **Built-in semantic colour theme.** The ninth `←`/`→` stop (`--native`)
|
|
58
|
+
paints by role instead of one accent colour: grey frame, bright-white machine
|
|
59
|
+
title and numbers, brown category box names, near-white field names, dim
|
|
60
|
+
secondary text, blue IO rates, cyan IP addresses, green normal bars, yellow
|
|
61
|
+
footer key hints, and amber/red only for warnings. The palette is fixed
|
|
62
|
+
xterm-256 output, so it does not depend on the terminal profile.
|
|
63
|
+
- **Readable tables.** In the process, network and single-card GPU tables only
|
|
64
|
+
the header row and the current sort column stay bright; other normal cells
|
|
65
|
+
are dim. GPU card BUSY/VRAM bars follow the same green/amber/red thresholds.
|
|
66
|
+
- **`--no-color` stays monochrome** and remains outside the colour ring.
|
|
67
|
+
|
|
68
|
+

|
|
69
|
+
|
|
55
70
|
## What's new in 3.0
|
|
56
71
|
|
|
57
72
|
- **Runs on Linux** (x86_64/arm64/LoongArch64) from the same package: `/proc`
|
|
@@ -76,6 +91,10 @@ disk I/O and network, updating once per second:
|
|
|
76
91
|
|
|
77
92
|

|
|
78
93
|
|
|
94
|
+
The built-in semantic palette (`--native`, the ninth colour stop):
|
|
95
|
+
|
|
96
|
+

|
|
97
|
+
|
|
79
98
|
Same view in another colour theme (press ← / → to cycle through them):
|
|
80
99
|
|
|
81
100
|

|
|
@@ -145,6 +164,8 @@ macpm [--interval INTERVAL] [--color COLOR] [--avg AVG] [--show_cores [BOOL]] [-
|
|
|
145
164
|
|---|---|
|
|
146
165
|
| `--interval SECONDS` | Sampling and display interval (default `1`) |
|
|
147
166
|
| `--color 1-8` | Display colour (default `2`) |
|
|
167
|
+
| `--native` | Start in the built-in semantic colour theme |
|
|
168
|
+
| `--no-color` | Use the terminal's default foreground (no accent colour) |
|
|
148
169
|
| `--avg SECONDS` | Averaging window for power values (default `30`) |
|
|
149
170
|
| `--show_cores [BOOL]` | Start in the per-core view |
|
|
150
171
|
| `--no-public-ip` | Do not look up the public IP and location |
|
|
@@ -166,7 +187,19 @@ Ctrl+R reset peaks
|
|
|
166
187
|
## Colour themes
|
|
167
188
|
|
|
168
189
|
Pick one with `--color N`, or press ← / → while macpm is running. The default
|
|
169
|
-
is `2` (green).
|
|
190
|
+
is `2` (green). The ring has nine stops: `1`-`8` paint the whole UI in one ANSI
|
|
191
|
+
accent colour, and the ninth (`--native`, or → from `8`) uses macpm's own
|
|
192
|
+
semantic palette instead: frame lines stay grey, the machine title and numbers
|
|
193
|
+
are bright white, category box names (Memory, Power, Disk IO, Network IO) are
|
|
194
|
+
brown, field names near-white, ordinary text dim, IO rates blue, IP addresses
|
|
195
|
+
cyan, normal bars the original green, footer key hints yellow, and only
|
|
196
|
+
warnings/critical readings use amber/red. In the process, network and
|
|
197
|
+
single-card GPU tables only the header row and the current sort column are
|
|
198
|
+
bright; the other normal cells stay dim. The palette uses fixed xterm-256
|
|
199
|
+
indices (16-255), so it does not follow the terminal profile.
|
|
200
|
+
|
|
201
|
+
`--no-color` is outside the ring: it keeps the terminal's default foreground
|
|
202
|
+
for a monochrome setup or a terminal-side keyword highlighter.
|
|
170
203
|
|
|
171
204
|
| | |
|
|
172
205
|
|---|---|
|
|
@@ -334,7 +367,7 @@ shows `n/a` and the reason stays in the data
|
|
|
334
367
|
|
|
335
368
|
A single-GPU machine keeps the older layout: card summary on top, process table
|
|
336
369
|
below. Every view's footer starts with the app name and version
|
|
337
|
-
(`macpm v3.
|
|
370
|
+
(`macpm v3.3.0 · q quit …`).
|
|
338
371
|
|
|
339
372
|
```text
|
|
340
373
|
┌ GPU INFO ────────────────────────────────────────────────────────────────────────────────┐
|
|
@@ -348,7 +381,7 @@ below. Every view's footer starts with the app name and version
|
|
|
348
381
|
│ └ 222 Xorg 2.0G │
|
|
349
382
|
│ 2 AMD GPU (amdgpu) ▉▉▉▉▏▏ 60% 1100/1750 12.0W ▉▉▉▉▏▏▏▏▏▏ 3.0G/8.0G 46°C │
|
|
350
383
|
│ 3 AMD GPU (amdgpu) ▉▉▉▉▉▏ 85% 1200/1750 12.0W ▉▉▉▉▉▏▏▏▏▏ 4.0G/8.0G 49°C │
|
|
351
|
-
└ macpm v3.
|
|
384
|
+
└ macpm v3.3.0 · q quit 1-5 view s sort ↑/↓ page Space pause ←/→ colour ────────────────┘
|
|
352
385
|
```
|
|
353
386
|
|
|
354
387
|
| Platform | What fills each row |
|
|
@@ -387,6 +420,11 @@ Notes:
|
|
|
387
420
|
idle ones every 30 s, with a minute of backoff after three failures, and it
|
|
388
421
|
stops ~10 s after the view is closed. Without root `footprint` can only read
|
|
389
422
|
your own processes; the rest keep `n/a`.
|
|
423
|
+
- On macOS, the table keeps a process listed while it holds GPU memory even
|
|
424
|
+
when its `GPU%` is momentarily 0 (a browser between frames), and the `CARD`
|
|
425
|
+
column is omitted: a Mac has one integrated GPU, so it would only ever show
|
|
426
|
+
`-`. On Linux multi-GPU hosts `CARD` still shows the index/range the process
|
|
427
|
+
holds.
|
|
390
428
|
- The nested process line comes from the vendor's own compute-process list
|
|
391
429
|
(`ixsmi pmon`/`--query-compute-apps`, `dlsmi --query-compute-apps`,
|
|
392
430
|
`teco-smi pmon`) or, on macOS and DRM GPUs, from `fdinfo`/IOAccelerator. A
|
|
@@ -412,6 +450,11 @@ Notes:
|
|
|
412
450
|
placements, so their difference is never used as "private" memory; anything
|
|
413
451
|
unprovable stays `n/a` rather than being guessed. Other users' processes
|
|
414
452
|
need root to be inspected, and their bytes show as unattributed.
|
|
453
|
+
- The card table sizes `NAME` to the longest card plus padding rather than
|
|
454
|
+
stretching it; the spare width goes to the VRAM bar. On narrow terminals it
|
|
455
|
+
sheds columns, and the VRAM cell shrinks to a short bar with compact numbers
|
|
456
|
+
(then to numbers only) before the column is dropped, so memory stays visible
|
|
457
|
+
down to ~74 columns.
|
|
415
458
|
- The default view's GPU gauge shows the busiest card and appends `(max of N)`
|
|
416
459
|
when the machine has more than one.
|
|
417
460
|
|
|
@@ -10,6 +10,21 @@ A Python-based `nvtop`-inspired terminal monitor for Apple Silicon Macs,
|
|
|
10
10
|
forked from [asitop](https://github.com/tlkh/asitop), with an x86_64/arm64
|
|
11
11
|
Linux backend.
|
|
12
12
|
|
|
13
|
+
## What's new in 3.3
|
|
14
|
+
|
|
15
|
+
- **Built-in semantic colour theme.** The ninth `←`/`→` stop (`--native`)
|
|
16
|
+
paints by role instead of one accent colour: grey frame, bright-white machine
|
|
17
|
+
title and numbers, brown category box names, near-white field names, dim
|
|
18
|
+
secondary text, blue IO rates, cyan IP addresses, green normal bars, yellow
|
|
19
|
+
footer key hints, and amber/red only for warnings. The palette is fixed
|
|
20
|
+
xterm-256 output, so it does not depend on the terminal profile.
|
|
21
|
+
- **Readable tables.** In the process, network and single-card GPU tables only
|
|
22
|
+
the header row and the current sort column stay bright; other normal cells
|
|
23
|
+
are dim. GPU card BUSY/VRAM bars follow the same green/amber/red thresholds.
|
|
24
|
+
- **`--no-color` stays monochrome** and remains outside the colour ring.
|
|
25
|
+
|
|
26
|
+

|
|
27
|
+
|
|
13
28
|
## What's new in 3.0
|
|
14
29
|
|
|
15
30
|
- **Runs on Linux** (x86_64/arm64/LoongArch64) from the same package: `/proc`
|
|
@@ -34,6 +49,10 @@ disk I/O and network, updating once per second:
|
|
|
34
49
|
|
|
35
50
|

|
|
36
51
|
|
|
52
|
+
The built-in semantic palette (`--native`, the ninth colour stop):
|
|
53
|
+
|
|
54
|
+

|
|
55
|
+
|
|
37
56
|
Same view in another colour theme (press ← / → to cycle through them):
|
|
38
57
|
|
|
39
58
|

|
|
@@ -103,6 +122,8 @@ macpm [--interval INTERVAL] [--color COLOR] [--avg AVG] [--show_cores [BOOL]] [-
|
|
|
103
122
|
|---|---|
|
|
104
123
|
| `--interval SECONDS` | Sampling and display interval (default `1`) |
|
|
105
124
|
| `--color 1-8` | Display colour (default `2`) |
|
|
125
|
+
| `--native` | Start in the built-in semantic colour theme |
|
|
126
|
+
| `--no-color` | Use the terminal's default foreground (no accent colour) |
|
|
106
127
|
| `--avg SECONDS` | Averaging window for power values (default `30`) |
|
|
107
128
|
| `--show_cores [BOOL]` | Start in the per-core view |
|
|
108
129
|
| `--no-public-ip` | Do not look up the public IP and location |
|
|
@@ -124,7 +145,19 @@ Ctrl+R reset peaks
|
|
|
124
145
|
## Colour themes
|
|
125
146
|
|
|
126
147
|
Pick one with `--color N`, or press ← / → while macpm is running. The default
|
|
127
|
-
is `2` (green).
|
|
148
|
+
is `2` (green). The ring has nine stops: `1`-`8` paint the whole UI in one ANSI
|
|
149
|
+
accent colour, and the ninth (`--native`, or → from `8`) uses macpm's own
|
|
150
|
+
semantic palette instead: frame lines stay grey, the machine title and numbers
|
|
151
|
+
are bright white, category box names (Memory, Power, Disk IO, Network IO) are
|
|
152
|
+
brown, field names near-white, ordinary text dim, IO rates blue, IP addresses
|
|
153
|
+
cyan, normal bars the original green, footer key hints yellow, and only
|
|
154
|
+
warnings/critical readings use amber/red. In the process, network and
|
|
155
|
+
single-card GPU tables only the header row and the current sort column are
|
|
156
|
+
bright; the other normal cells stay dim. The palette uses fixed xterm-256
|
|
157
|
+
indices (16-255), so it does not follow the terminal profile.
|
|
158
|
+
|
|
159
|
+
`--no-color` is outside the ring: it keeps the terminal's default foreground
|
|
160
|
+
for a monochrome setup or a terminal-side keyword highlighter.
|
|
128
161
|
|
|
129
162
|
| | |
|
|
130
163
|
|---|---|
|
|
@@ -292,7 +325,7 @@ shows `n/a` and the reason stays in the data
|
|
|
292
325
|
|
|
293
326
|
A single-GPU machine keeps the older layout: card summary on top, process table
|
|
294
327
|
below. Every view's footer starts with the app name and version
|
|
295
|
-
(`macpm v3.
|
|
328
|
+
(`macpm v3.3.0 · q quit …`).
|
|
296
329
|
|
|
297
330
|
```text
|
|
298
331
|
┌ GPU INFO ────────────────────────────────────────────────────────────────────────────────┐
|
|
@@ -306,7 +339,7 @@ below. Every view's footer starts with the app name and version
|
|
|
306
339
|
│ └ 222 Xorg 2.0G │
|
|
307
340
|
│ 2 AMD GPU (amdgpu) ▉▉▉▉▏▏ 60% 1100/1750 12.0W ▉▉▉▉▏▏▏▏▏▏ 3.0G/8.0G 46°C │
|
|
308
341
|
│ 3 AMD GPU (amdgpu) ▉▉▉▉▉▏ 85% 1200/1750 12.0W ▉▉▉▉▉▏▏▏▏▏ 4.0G/8.0G 49°C │
|
|
309
|
-
└ macpm v3.
|
|
342
|
+
└ macpm v3.3.0 · q quit 1-5 view s sort ↑/↓ page Space pause ←/→ colour ────────────────┘
|
|
310
343
|
```
|
|
311
344
|
|
|
312
345
|
| Platform | What fills each row |
|
|
@@ -345,6 +378,11 @@ Notes:
|
|
|
345
378
|
idle ones every 30 s, with a minute of backoff after three failures, and it
|
|
346
379
|
stops ~10 s after the view is closed. Without root `footprint` can only read
|
|
347
380
|
your own processes; the rest keep `n/a`.
|
|
381
|
+
- On macOS, the table keeps a process listed while it holds GPU memory even
|
|
382
|
+
when its `GPU%` is momentarily 0 (a browser between frames), and the `CARD`
|
|
383
|
+
column is omitted: a Mac has one integrated GPU, so it would only ever show
|
|
384
|
+
`-`. On Linux multi-GPU hosts `CARD` still shows the index/range the process
|
|
385
|
+
holds.
|
|
348
386
|
- The nested process line comes from the vendor's own compute-process list
|
|
349
387
|
(`ixsmi pmon`/`--query-compute-apps`, `dlsmi --query-compute-apps`,
|
|
350
388
|
`teco-smi pmon`) or, on macOS and DRM GPUs, from `fdinfo`/IOAccelerator. A
|
|
@@ -370,6 +408,11 @@ Notes:
|
|
|
370
408
|
placements, so their difference is never used as "private" memory; anything
|
|
371
409
|
unprovable stays `n/a` rather than being guessed. Other users' processes
|
|
372
410
|
need root to be inspected, and their bytes show as unattributed.
|
|
411
|
+
- The card table sizes `NAME` to the longest card plus padding rather than
|
|
412
|
+
stretching it; the spare width goes to the VRAM bar. On narrow terminals it
|
|
413
|
+
sheds columns, and the VRAM cell shrinks to a short bar with compact numbers
|
|
414
|
+
(then to numbers only) before the column is dropped, so memory stays visible
|
|
415
|
+
down to ~74 columns.
|
|
373
416
|
- The default view's GPU gauge shows the busiest card and appends `(max of N)`
|
|
374
417
|
when the machine has more than one.
|
|
375
418
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Releasing macpm 3.
|
|
1
|
+
# Releasing macpm 3.3.0
|
|
2
2
|
|
|
3
3
|
This checklist prepares a GitHub tag and a PyPI upload. It does not push or
|
|
4
4
|
publish anything by itself.
|
|
@@ -7,11 +7,11 @@ publish anything by itself.
|
|
|
7
7
|
|
|
8
8
|
- macOS Apple Silicon, Python 3.9+.
|
|
9
9
|
- Clean working tree (`git status`), all tests passing.
|
|
10
|
-
- Version is `3.
|
|
10
|
+
- Version is `3.3.0` in:
|
|
11
11
|
- `setup.py`
|
|
12
12
|
- `macpm/__init__.py` (`__version__`)
|
|
13
13
|
- the banner and `--version` derive from it (`macpm/macpm.py`)
|
|
14
|
-
- `CHANGELOG.md` has the `3.
|
|
14
|
+
- `CHANGELOG.md` has the `3.3.0` entry.
|
|
15
15
|
|
|
16
16
|
## 2. Test from source
|
|
17
17
|
|
|
@@ -38,7 +38,7 @@ Test the wheel in a **clean** venv (this is the real "no source tree" test):
|
|
|
38
38
|
|
|
39
39
|
```sh
|
|
40
40
|
python3 -m venv /tmp/macpm-wheel-test
|
|
41
|
-
/tmp/macpm-wheel-test/bin/pip install dist/macpm-3.
|
|
41
|
+
/tmp/macpm-wheel-test/bin/pip install dist/macpm-3.3.0-py3-none-any.whl
|
|
42
42
|
/tmp/macpm-wheel-test/bin/macpm --help
|
|
43
43
|
/tmp/macpm-wheel-test/bin/macpm-dump # Ctrl+C
|
|
44
44
|
```
|
|
@@ -78,13 +78,13 @@ Manual alternative (fallback, e.g. when OIDC is unavailable):
|
|
|
78
78
|
```sh
|
|
79
79
|
# requires a PyPI API token in ~/.pypirc or TWINE_PASSWORD
|
|
80
80
|
python3 -m twine upload --non-interactive \
|
|
81
|
-
dist/macpm-3.
|
|
81
|
+
dist/macpm-3.3.0.tar.gz dist/macpm-3.3.0-py3-none-any.whl
|
|
82
82
|
```
|
|
83
83
|
|
|
84
84
|
Then verify:
|
|
85
85
|
|
|
86
86
|
```sh
|
|
87
|
-
python3 -m pip install --upgrade macpm==3.
|
|
87
|
+
python3 -m pip install --upgrade macpm==3.3.0
|
|
88
88
|
macpm --version
|
|
89
89
|
```
|
|
90
90
|
|
|
@@ -93,10 +93,10 @@ macpm --version
|
|
|
93
93
|
```sh
|
|
94
94
|
git add setup.py pyproject.toml MANIFEST.in README.md CHANGELOG.md RELEASE.md \
|
|
95
95
|
macpm packaging tests .github bin
|
|
96
|
-
git commit -m "Release macpm 3.
|
|
97
|
-
git tag -a v3.
|
|
96
|
+
git commit -m "Release macpm 3.3.0: built-in semantic colour theme"
|
|
97
|
+
git tag -a v3.3.0 -m "macpm 3.3.0"
|
|
98
98
|
git push origin main
|
|
99
|
-
git push origin v3.
|
|
99
|
+
git push origin v3.3.0
|
|
100
100
|
```
|
|
101
101
|
|
|
102
102
|
The `Release` workflow builds the sdist/wheel, checks metadata and attaches
|
|
@@ -122,7 +122,7 @@ PYTHON=python3 packaging/build.sh
|
|
|
122
122
|
This produces:
|
|
123
123
|
|
|
124
124
|
```text
|
|
125
|
-
dist/macpm-3.
|
|
125
|
+
dist/macpm-3.3.0-macos-arm64.tar.gz
|
|
126
126
|
```
|
|
127
127
|
|
|
128
128
|
Attach it to the GitHub release. The binaries are ad-hoc signed, not
|
|
@@ -148,10 +148,10 @@ The first run downloads python-build-standalone (cached in
|
|
|
148
148
|
`~/.cache/macpm-build/pbs`) and produces:
|
|
149
149
|
|
|
150
150
|
```text
|
|
151
|
-
dist/macpm-3.
|
|
152
|
-
dist/macpm-3.
|
|
153
|
-
dist/macpm_3.
|
|
154
|
-
dist/macpm_3.
|
|
151
|
+
dist/macpm-3.3.0-linux-x86_64.tar.gz
|
|
152
|
+
dist/macpm-3.3.0-linux-aarch64.tar.gz
|
|
153
|
+
dist/macpm_3.3.0_amd64.deb
|
|
154
|
+
dist/macpm_3.3.0_arm64.deb
|
|
155
155
|
```
|
|
156
156
|
|
|
157
157
|
Both architectures keep a glibc 2.17 floor. Building x86_64 on an arm64 host
|
|
@@ -7,6 +7,7 @@ blessed/ANSI so views 1/2 share the palette and border helpers of views 3-5.
|
|
|
7
7
|
|
|
8
8
|
from __future__ import annotations
|
|
9
9
|
|
|
10
|
+
from .theme import KEY, OK, TITLE, UniformPalette, metric_spans, paint_spans, severity, title_spans
|
|
10
11
|
from .tui import RESET_FG, _border, _bottom, _fit, _pad
|
|
11
12
|
|
|
12
13
|
_VBARS = "▁▂▃▄▅▆▇█"
|
|
@@ -27,21 +28,39 @@ def _bordered(tile) -> bool:
|
|
|
27
28
|
return getattr(tile, "border_color", None) is not None
|
|
28
29
|
|
|
29
30
|
|
|
30
|
-
def _write(out: list, term, row: int, column: int, text: str,
|
|
31
|
+
def _write(out: list, term, row: int, column: int, text: str, palette, role=None) -> None:
|
|
31
32
|
# Always write, including spaces: the terminal keeps stale cells when a
|
|
32
33
|
# bar shrinks, which looked like a horizontal streak at the chart top.
|
|
33
|
-
|
|
34
|
+
if getattr(palette, "native", False):
|
|
35
|
+
spans = metric_spans(text, role or KEY)
|
|
36
|
+
else:
|
|
37
|
+
spans = [(text, role)]
|
|
38
|
+
out.append(term.move(row, column) + paint_spans(spans, palette))
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
def _write_spans(out: list, term, row: int, column: int, spans, palette, width=None) -> None:
|
|
42
|
+
out.append(term.move(row, column) + paint_spans(spans, palette, width))
|
|
34
43
|
|
|
35
44
|
|
|
36
|
-
def _box(tile, row, col, width, height, out, term,
|
|
45
|
+
def _box(tile, row, col, width, height, out, term, palette) -> None:
|
|
46
|
+
color = palette.accent()
|
|
47
|
+
title_role = getattr(tile, "title_role", None) or TITLE
|
|
37
48
|
title = getattr(tile, "title", "") or ""
|
|
38
49
|
bottom = getattr(tile, "bottom_title", "") or ""
|
|
39
50
|
line = _fit(f" {title} ", max(0, width - 2)) if title else ""
|
|
40
51
|
out.append(term.move(row, col) + color + _border(width, line) + RESET_FG)
|
|
52
|
+
if line:
|
|
53
|
+
_write_spans(out, term, row, col + 1, title_spans(line, title_role), palette)
|
|
41
54
|
if height > 1:
|
|
42
55
|
out.append(
|
|
43
56
|
term.move(row + height - 1, col) + color + _bottom(width, bottom) + RESET_FG
|
|
44
57
|
)
|
|
58
|
+
fitted_bottom = _fit(bottom, max(0, width - 2))
|
|
59
|
+
if fitted_bottom:
|
|
60
|
+
_write_spans(
|
|
61
|
+
out, term, row + height - 1, col + 1,
|
|
62
|
+
metric_spans(fitted_bottom, TITLE), palette,
|
|
63
|
+
)
|
|
45
64
|
for offset in range(1, max(1, height - 1)):
|
|
46
65
|
out.append(term.move(row + offset, col) + color + "│" + RESET_FG)
|
|
47
66
|
out.append(
|
|
@@ -122,7 +141,7 @@ def _chart_values(tile, width: int) -> list:
|
|
|
122
141
|
return points[-width:] if width > 0 else []
|
|
123
142
|
|
|
124
143
|
|
|
125
|
-
def _chart(tile, row, col, width, height, out, term,
|
|
144
|
+
def _chart(tile, row, col, width, height, out, term, palette) -> None:
|
|
126
145
|
points = _chart_values(tile, width)
|
|
127
146
|
# Newest sample sits at the right edge; older ones scroll out to the left.
|
|
128
147
|
offset = width - len(points)
|
|
@@ -138,25 +157,45 @@ def _chart(tile, row, col, width, height, out, term, color) -> None:
|
|
|
138
157
|
chars.append(_VBARS[min(7, max(0, int(level * 8) - 1))])
|
|
139
158
|
else:
|
|
140
159
|
chars.append(" ")
|
|
141
|
-
_write(out, term, row + line, col, "".join(chars),
|
|
160
|
+
_write(out, term, row + line, col, "".join(chars), palette, OK)
|
|
142
161
|
|
|
143
162
|
|
|
144
|
-
def _sensor(tile, row, col, width, height, out, term,
|
|
163
|
+
def _sensor(tile, row, col, width, height, out, term, palette) -> None:
|
|
145
164
|
lines = list(getattr(tile, "lines", []) or [])
|
|
165
|
+
styled = [list(line) for line in (getattr(tile, "styled_lines", []) or [])]
|
|
146
166
|
levels = getattr(tile, "levels", None)
|
|
147
|
-
if levels
|
|
148
|
-
|
|
167
|
+
if levels:
|
|
168
|
+
fan_line = [(tile._fan_bars(max(0, width - 1)), None)]
|
|
169
|
+
if styled:
|
|
170
|
+
if len(styled) < height:
|
|
171
|
+
styled.append(fan_line)
|
|
172
|
+
elif len(lines) < height:
|
|
173
|
+
lines.append(tile._fan_bars(max(0, width - 1)))
|
|
149
174
|
for offset in range(height):
|
|
150
|
-
|
|
151
|
-
|
|
175
|
+
if offset < len(styled):
|
|
176
|
+
_write_spans(out, term, row + offset, col, styled[offset], palette, width)
|
|
177
|
+
elif offset < len(lines):
|
|
178
|
+
text = _pad(_fit(lines[offset], width), width)
|
|
179
|
+
_write(out, term, row + offset, col, text, palette, KEY)
|
|
180
|
+
else:
|
|
181
|
+
_write_spans(out, term, row + offset, col, [], palette, width)
|
|
182
|
+
|
|
183
|
+
|
|
184
|
+
def _bar_role(palette, tile):
|
|
185
|
+
if not getattr(palette, "native", False):
|
|
186
|
+
return None
|
|
187
|
+
metric = getattr(tile, "metric", None)
|
|
188
|
+
if not metric:
|
|
189
|
+
return None
|
|
190
|
+
return severity(metric, getattr(tile, "value", 0))
|
|
152
191
|
|
|
153
192
|
|
|
154
|
-
def paint(tile, row, col, width, height, out, term,
|
|
193
|
+
def paint(tile, row, col, width, height, out, term, palette) -> None:
|
|
155
194
|
if width <= 0 or height <= 0:
|
|
156
195
|
return
|
|
157
196
|
bordered = _bordered(tile) and width >= 3 and height >= 3
|
|
158
197
|
if bordered:
|
|
159
|
-
_box(tile, row, col, width, height, out, term,
|
|
198
|
+
_box(tile, row, col, width, height, out, term, palette)
|
|
160
199
|
row, col, width, height = row + 1, col + 1, width - 2, height - 2
|
|
161
200
|
|
|
162
201
|
name = type(tile).__name__
|
|
@@ -165,7 +204,7 @@ def paint(tile, row, col, width, height, out, term, color) -> None:
|
|
|
165
204
|
if name in ("VSplit", "FillVSplit"):
|
|
166
205
|
y = row
|
|
167
206
|
for item, child_height in zip(items, _heights(tile, height)):
|
|
168
|
-
paint(item, y, col, width, child_height, out, term,
|
|
207
|
+
paint(item, y, col, width, child_height, out, term, palette)
|
|
169
208
|
y += child_height
|
|
170
209
|
else:
|
|
171
210
|
x = col
|
|
@@ -175,7 +214,7 @@ def paint(tile, row, col, width, height, out, term, color) -> None:
|
|
|
175
214
|
# one long bar. Bordered panels already have their own frame,
|
|
176
215
|
# so they stay flush.
|
|
177
216
|
gutter = 1 if index < len(items) - 1 and not _bordered(item) else 0
|
|
178
|
-
paint(item, row, x, max(0, child_width - gutter), height, out, term,
|
|
217
|
+
paint(item, row, x, max(0, child_width - gutter), height, out, term, palette)
|
|
179
218
|
x += child_width
|
|
180
219
|
return
|
|
181
220
|
|
|
@@ -183,25 +222,27 @@ def paint(tile, row, col, width, height, out, term, color) -> None:
|
|
|
183
222
|
start = 0
|
|
184
223
|
title = getattr(tile, "title", "") or ""
|
|
185
224
|
if title and not bordered:
|
|
186
|
-
_write(out, term, row, col, _pad(_fit(title, width), width),
|
|
225
|
+
_write(out, term, row, col, _pad(_fit(title, width), width), palette, KEY)
|
|
187
226
|
start = 1
|
|
188
227
|
if getattr(tile, "plain", False):
|
|
189
228
|
return
|
|
190
229
|
value = getattr(tile, "value", 0)
|
|
230
|
+
role = _bar_role(palette, tile)
|
|
191
231
|
# Fill every row the layout gave us. View 2 stretches the E/P usage
|
|
192
232
|
# gauges on purpose; the boxes with fixed content height (Memory) cap
|
|
193
233
|
# theirs so this does not repeat a reading there.
|
|
194
234
|
for line in range(start, height):
|
|
195
|
-
_write(out, term, row + line, col, _hbar(value, width),
|
|
235
|
+
_write(out, term, row + line, col, _hbar(value, width), palette, role)
|
|
196
236
|
elif name == "VGauge":
|
|
197
237
|
start = 0
|
|
198
238
|
title = getattr(tile, "title", "") or ""
|
|
199
239
|
if title and not bordered:
|
|
200
|
-
_write(out, term, row, col, _pad(_fit(title, width), width),
|
|
240
|
+
_write(out, term, row, col, _pad(_fit(title, width), width), palette, KEY)
|
|
201
241
|
start = 1
|
|
202
242
|
if getattr(tile, "plain", False):
|
|
203
243
|
return
|
|
204
244
|
value = getattr(tile, "value", 0)
|
|
245
|
+
role = _bar_role(palette, tile)
|
|
205
246
|
inner = max(0, height - start)
|
|
206
247
|
filled = inner * max(0.0, min(100.0, float(value))) / 100.0
|
|
207
248
|
# A vertical bar, not full-width stripes: the height follows the value
|
|
@@ -219,24 +260,25 @@ def paint(tile, row, col, width, height, out, term, color) -> None:
|
|
|
219
260
|
char = _VBARS[min(7, max(0, int(level * 8) - 1))]
|
|
220
261
|
else:
|
|
221
262
|
char = " "
|
|
222
|
-
_write(out, term, row + line, bar_col, char * bar_width,
|
|
263
|
+
_write(out, term, row + line, bar_col, char * bar_width, palette, role)
|
|
223
264
|
elif name == "HChart":
|
|
224
265
|
start = 0
|
|
225
266
|
title = getattr(tile, "title", "") or ""
|
|
226
267
|
if title and not bordered:
|
|
227
|
-
_write(out, term, row, col, _pad(_fit(title, width), width),
|
|
268
|
+
_write(out, term, row, col, _pad(_fit(title, width), width), palette, KEY)
|
|
228
269
|
start = 1
|
|
229
|
-
_chart(tile, row + start, col, width, height - start, out, term,
|
|
270
|
+
_chart(tile, row + start, col, width, height - start, out, term, palette)
|
|
230
271
|
elif name == "SensorPanel":
|
|
231
|
-
_sensor(tile, row, col, width, height, out, term,
|
|
272
|
+
_sensor(tile, row, col, width, height, out, term, palette)
|
|
232
273
|
else:
|
|
233
274
|
title = getattr(tile, "title", "") or ""
|
|
234
275
|
if title:
|
|
235
|
-
_write(out, term, row, col, _fit(title, width),
|
|
276
|
+
_write(out, term, row, col, _fit(title, width), palette, KEY)
|
|
236
277
|
|
|
237
278
|
|
|
238
279
|
def render_tiles(tile, term, color) -> None:
|
|
239
280
|
"""Paint ``tile`` over the terminal, leaving the footer row free."""
|
|
281
|
+
palette = color if hasattr(color, "style") else UniformPalette(color)
|
|
240
282
|
out: list = []
|
|
241
|
-
paint(tile, 0, 0, term.width, max(1, term.height - 1), out, term,
|
|
283
|
+
paint(tile, 0, 0, term.width, max(1, term.height - 1), out, term, palette)
|
|
242
284
|
print("".join(out), end="", flush=True)
|
|
@@ -147,6 +147,9 @@ class FootprintPoller:
|
|
|
147
147
|
self._entries: dict = {}
|
|
148
148
|
self._targets: dict = {}
|
|
149
149
|
self._targets_at = 0.0
|
|
150
|
+
# Rotates the idle targets when there are more of them than
|
|
151
|
+
# MAX_TARGETS, so a process beyond the cap still gets measured.
|
|
152
|
+
self._rotation = 0
|
|
150
153
|
self._lock = threading.Lock()
|
|
151
154
|
self._stop = threading.Event()
|
|
152
155
|
self._thread: Optional[threading.Thread] = None
|
|
@@ -186,9 +189,18 @@ class FootprintPoller:
|
|
|
186
189
|
|
|
187
190
|
def poll_once(self) -> None:
|
|
188
191
|
with self._lock:
|
|
189
|
-
|
|
192
|
+
items = sorted(
|
|
190
193
|
self._targets.items(), key=lambda item: (not item[1], item[0])
|
|
191
|
-
)
|
|
194
|
+
)
|
|
195
|
+
busy = [item for item in items if item[1]]
|
|
196
|
+
idle = [item for item in items if not item[1]]
|
|
197
|
+
if len(items) > self.MAX_TARGETS and idle:
|
|
198
|
+
slots = max(0, self.MAX_TARGETS - len(busy))
|
|
199
|
+
if slots:
|
|
200
|
+
start = self._rotation % len(idle)
|
|
201
|
+
idle = idle[start:] + idle[:start]
|
|
202
|
+
self._rotation = (start + slots) % len(idle)
|
|
203
|
+
targets = (busy + idle)[: self.MAX_TARGETS]
|
|
192
204
|
now = self._clock()
|
|
193
205
|
for pid, busy in targets:
|
|
194
206
|
if self._stop.is_set():
|