Skip to content
jc-rs
GitHub

iostat

--iostatv1.1.0

Converts `iostat` command output to JSON

Linuxcommand
$ iostat | jc-rs --iostat

A real pair

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

iostatcentos-7.7
Linux 3.10.0-1062.1.2.el7.x86_64 (localhost.localdomain) 	11/30/2021 	_x86_64_	(1 CPU)

avg-cpu:  %user   %nice %system %iowait  %steal   %idle
           0.14    0.00    0.16    0.00    0.00   99.70

Device:            tps    MB_read/s    MB_wrtn/s    MB_read    MB_wrtn
sda               0.24         0.01         0.00        198         41
dm-0              0.25         0.00         0.00        166         39
dm-1              0.00         0.00         0.00          2          0
expected outputjson
Use the Left and Right arrow keys to highlight the matching value in the input.
[
  {
    "percent_user": 0.14,
    "percent_nice": 0.0,
    "percent_system": 0.16,
    "percent_iowait": 0.0,
    "percent_steal": 0.0,
    "percent_idle": 99.7,
    "type": "cpu"
  },
  {
    "device": "sda",
    "tps": 0.24,
    "mb_read_s": 0.01,
    "mb_wrtn_s": 0.0,
    "mb_read": 198,
    "mb_wrtn": 41,
    "type": "device"
  },
  {
    "device": "dm-0",
    "tps": 0.25,
    "mb_read_s": 0.0,
    "mb_wrtn_s": 0.0,
    "mb_read": 166,
    "mb_wrtn": 39,
    "type": "device"
  },
  {
    "device": "dm-1",
    "tps": 0.0,
    "mb_read_s": 0.0,
    "mb_wrtn_s": 0.0,
    "mb_read": 2,
    "mb_wrtn": 0,
    "type": "device"
  }
]

Fixture coverage

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

Magic syntax

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

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