Skip to content
jc-rs
GitHub

mpstat

--mpstatv1.1.0

Converts `mpstat` command output to JSON

Linuxcommand
$ mpstat | jc-rs --mpstat

A real pair

From the reference corpus (centos-7.7/mpstat.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.

mpstatcentos-7.7
Linux 3.10.0-1062.1.2.el7.x86_64 (localhost) 	03/11/2022 	_x86_64_	(1 CPU)

03:14:20 PM  CPU    %usr   %nice    %sys %iowait    %irq   %soft  %steal  %guest  %gnice   %idle
03:14:20 PM  all    0.23    0.00    0.37    0.01    0.00    0.00    0.00    0.00    0.00   99.39
expected outputjson
Use the Left and Right arrow keys to highlight the matching value in the input.
[
  {
    "cpu": "all",
    "percent_usr": 0.23,
    "percent_nice": 0.0,
    "percent_sys": 0.37,
    "percent_iowait": 0.01,
    "percent_irq": 0.0,
    "percent_soft": 0.0,
    "percent_steal": 0.0,
    "percent_guest": 0.0,
    "percent_gnice": 0.0,
    "percent_idle": 99.39,
    "type": "cpu",
    "time": "03:14:20 PM"
  }
]

Fixture coverage

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

Magic syntax

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

Source: crates/jc-rs-parsers/src/system/mpstat.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