feat: add pidstat post-processing for per-process CPU metrics#54
Conversation
Add pidstat parsing to sysstat-post-process that produces per-process CPU metrics using the same Busy-CPU/NonBusy-CPU pattern as mpstat. Each process is identified by command name and PID in the metric names, with the CPU field type (usr, system, guest, wait) as a breakout dimension. Uses a two-pass approach: first scan identifies PIDs with any non-zero activity, then only those PIDs are processed (configurable via $skip_zero_pids). This filters out ~90% of idle process data while preserving time-series continuity for active processes. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
b0434da to
2c1145c
Compare
|
Here is an example |
atheurer
left a comment
There was a problem hiding this comment.
If I recall, I think my main issue with not writing this sooner was that handling pidstat with threads present or not present was possibly going to be different. I don't recall exactly what the issue was, but it might have been the %busy in the PID vs children TIDs.
Does the tool even support that (threads mode)? From a quick I don't think so: https://github.com/perftool-incubator/tool-sysstat/blob/master/sysstat-start#L60-L66 |
Summary
Add pidstat parsing to
sysstat-post-processthat produces per-process CPU metrics following the same Busy-CPU/NonBusy-CPU pattern used by mpstat:Busy-CPU; %wait →NonBusy-CPUcmd(process name),pid(process ID),type(usr/system/guest/wait)$skip_zero_pidsvariable. Filters ~90% of idle process data while preserving time-series continuity.Test plan
metric-data-pidstat.csv.xzandmetric-data-pidstat.json.xzare createdcrucible get metric --source pidstat --type Busy-CPU --breakout cstype,csid,cmd,pid,typereturns data🤖 Generated with Claude Code