Skip to content
jc-rs
GitHub

pidstat

--pidstatv1.3.0

Converts `pidstat -H` command output to JSON

Linuxcommand
$ pidstat | jc-rs --pidstat

A real pair

From the reference corpus (generic/pidstat-ht.json). The left pane is the input the fixture ships; the right pane is the corpus's expected JSON. CI compares jc-rs with it field by field under the published differential. Hover a value to see where it came from.

pidstatgeneric
Linux 4.18.0-477.10.1.el8_8.x86_64 (localhost.localdomain) 	08/20/2023 	_x86_64_	(1 CPU)

# Time        UID       PID    %usr %system  %guest   %wait    %CPU   CPU  Command
1692579199      0         1    0.00    0.07    0.00    0.08    0.08     0  systemd

# Time        UID       PID    usr-ms system-ms  guest-ms  Command
1692579199      0         1      2890      4260         0  systemd
expected outputjson
Use the Left and Right arrow keys to highlight the matching value in the input.
[
  {
    "time": 1692579199,
    "uid": 0,
    "pid": 1,
    "percent_usr": 0.0,
    "percent_system": 0.07,
    "percent_guest": 0.0,
    "percent_wait": 0.08,
    "percent_cpu": 0.08,
    "cpu": 0,
    "command": "systemd"
  },
  {
    "time": 1692579199,
    "uid": 0,
    "pid": 1,
    "usr_ms": 2890,
    "system_ms": 4260,
    "guest_ms": 0,
    "command": "systemd"
  }
]

Fixture coverage

4/4oracle-valid pairs match under the published structural JSON comparison

Magic syntax

jc-rs pidstatjc-rs runs the command itself and parses what it prints. Recognised for: `pidstat`

Source: crates/jc-rs-parsers/src/system/pidstat.rs. jc-rs targets the schemas defined by the original Python tool. Fixture coverage above is the measured evidence for this parser; test the inputs your pipeline depends on. Compare