Repository navigation
wtf-perf v0.2.1
Why TF is my Windows PC busy? Task Manager can oddly show 45% CPU while its biggest process reads 3%. wtf-perf answers the uncomfortable question that leaves ("Is something hiding CPU, or do many small things really add up?") by accounting for every point of the headline.
This is the first release.
What it does
pip install wtf-perf
wtf-perf # sample 10 s and account for the CPU headline
wtf-perf cpu -s 15 # a 15-second window
wtf-perf cpu --json # the full report as JSONIt samples every process roughly every 100 ms -- including the ones that start and exit in under a second -- reads the system counters over the same window, and prints:
- A verdict -- it adds up (dominated by one application, or many small consumers), or it does not add up, with the points left unexplained.
- The ledger, in points (1 point = 1% of the whole machine):
headline = busy time + speed-scaling uplift, andbusy time = live processes (by size) + processes that exited during the window + interrupts/DPCs + unexplained. The uplift is why Task Manager can read higher than the time actually spent: its figure scales busy time by how fast the busy cores ran. - Applications -- processes rolled up into families (an editor, an agent, a browser, and all their helpers), because an application made of hundreds of small processes never ranks in Task Manager.
- Short-lived processes -- how many started and exited during the window, and which images.
- File operations -- I/O operation rates per application.
- Findings -- one process hogging, many small consumers, a family hidden behind small processes, heavy process churn, an inflated headline, interrupt- or kernel-heavy load, metadata storms.
Read-only, no elevation needed, no WMI or PowerShell: the kernel's process table and the performance counters are read directly, and the tool's own cost (about 1% of the machine) is reported in the output.
AI summary
wtf-perf cpu --ai # claude by default
wtf-perf cpu --ai lmstudio # or codex, ollama, prompt-only
wtf-perf cpu --ai --ai-detail fullA four-part summary (what happened, why, what to do, confidence). It sends process names and figures only; command lines go only with --ai-detail full, with a warning when the backend runs off the machine. The agent CLIs run with no tools and one turn. --ai-save keeps the choice.
Platforms
The data sources sit behind a per-platform provider set. wtf-perf cpu --providers lists them and whether each can run here; --platform picks a set (the detected platform by default). Windows is implemented and detailed; Linux and macOS are stubs that say which source is missing instead of sampling. See Platform support.
Also in this release
- Redirecting the report to a file on a non-UTF-8 console no longer crashes; unencodable characters are replaced.
--ai prompt-onlywrites prompts underWTF_PERF_CONFIG_DIRwhen it is set.- The test suite runs on Windows and Linux in CI.
- An installs badge and a public stats dashboard (clones, views, downloads), updated daily.
- New contributor guides: CONTRIBUTING, a pull request template and AGENTS.md, setting out what every change must keep (read-only, every point accounted for, nothing sent off the machine unless asked).
Known limits
- Processes shorter than the poll gap are never seen, so their CPU lands in the unexplained line; under heavy process churn that line can reach 3-4 points, and about three quarters of it is such processes. Recording the kernel's process-exit events would account for them: #3.
- Linux sampling from
/procis not implemented yet: #4. - More than 64 logical processors (more than one processor group) are not handled yet.
Installation
pip install wtf-perfFrom source:
git clone https://github.com/DazzleTools/wtf-perf.git
cd wtf-perf
pip install -e .Also available as wtf perf through wtf-windows.
Version History (0.2.x)
| Version | Key Change |
|---|---|
| v0.2.1 | Current -- first release: the CPU ledger, AI summary, per-platform providers, traffic badges |
| v0.2.0 | Not released separately -- folded into v0.2.1 |
The 0.1.x versions were development builds and were not released.
Platform Support
| Platform | Status |
|---|---|
| Windows 10/11 (x64) | Tested |
| Linux | Stub -- the test suite runs in CI; sampling not implemented (#4) |
| macOS | Stub -- not tested |
Requirements
Python 3.10+; dazzlecmd-lib, rich, dazzle-loglib (installed automatically).