Skip to content
jc-rs
GitHub

proc-stat

--proc-statv1.0.0

Converts `/proc/stat` file to JSON

Linuxfileslurpable
$ jc-rs /proc/stat

A real pair

From the reference corpus (linux-proc/stat2.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.

/proc/statlinux-proc
cpu  259246 7001 60190 34250993 137517 772 0
cpu0 259246 7001 60190 34250993 137517 772 0
intr 354133732 347209999 2272 0 4 4 0 0 3 1 1249247 0 0 80143 0 422626 5169433
ctxt 12547729
btime 1093631447
processes 130523
procs_running 1
procs_blocked 0
preempt 5651840
cpu  209841 1554 21720 118519346 72939 154 27168
cpu0 42536 798 4841 14790880 14778 124 3117
cpu1 24184 569 3875 14794524 30209 29 3130
cpu2 28616 11 2182 14818198 4020 1 3493
cpu3 35350 6 2942 14811519 3045 0 3659
cpu4 18209 135 2263 14820076 12465 0 3373
cpu5 20795 35 1866 14825701 4508 0 3615
cpu6 21607 0 2201 14827053 2325 0 3334
cpu7 18544 0 1550 14831395 1589 0 3447
intr 15239682 14857833 6 0 6 6 0 5 0 1 0 0 0 29 0 2 0 0 0 0 0 0 0 94982 0 286812
ctxt 4209609
btime 1078711415
processes 21905
procs_running 1
procs_blocked 0
expected outputjson
Use the Left and Right arrow keys to highlight the matching value in the input.
{
  "cpu": {
    "user": 209841,
    "nice": 1554,
    "system": 21720,
    "idle": 118519346,
    "iowait": 72939,
    "irq": 154,
    "softirq": 27168
  },
  "cpu0": {
    "user": 42536,
    "nice": 798,
    "system": 4841,
    "idle": 14790880,
    "iowait": 14778,
    "irq": 124,
    "softirq": 3117
  },
  "interrupts": [
    15239682,
    14857833,
    6,
    0,
    6,
    6,
    0,
    5,
    0,
    1,
    0,
    0,
    0,
    29,
    0,
    2,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    94982,
    0,
    286812
  ],
  "context_switches": 4209609,
  "boot_time": 1078711415,
  "processes": 21905,
  "processes_running": 1,
  "processes_blocked": 0,
  "cpu1": {
    "user": 24184,
    "nice": 569,
    "system": 3875,
    "idle": 14794524,
    "iowait": 30209,
    "irq": 29,
    "softirq": 3130
  },
  "cpu2": {
    "user": 28616,
    "nice": 11,
    "system": 2182,
    "idle": 14818198,
    "iowait": 4020,
    "irq": 1,
    "softirq": 3493
  },
  "cpu3": {
    "user": 35350,
    "nice": 6,
    "system": 2942,
    "idle": 14811519,
    "iowait": 3045,
    "irq": 0,
    "softirq": 3659
  },
  "cpu4": {
    "user": 18209,
    "nice": 135,
    "system": 2263,
    "idle": 14820076,
    "iowait": 12465,
    "irq": 0,
    "softirq": 3373
  },
  "cpu5": {
    "user": 20795,
    "nice": 35,
    "system": 1866,
    "idle": 14825701,
    "iowait": 4508,
    "irq": 0,
    "softirq": 3615
  },
  "cpu6": {
    "user": 21607,
    "nice": 0,
    "system": 2201,
    "idle": 14827053,
    "iowait": 2325,
    "irq": 0,
    "softirq": 3334
  },
  "cpu7": {
    "user": 18544,
    "nice": 0,
    "system": 1550,
    "idle": 14831395,
    "iowait": 1589,
    "irq": 0,
    "softirq": 3447
  }
}

Fixture coverage

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

Magic syntax

jc-rs /proc/statjc-rs reads this kernel-interface file directly and dispatches it through the matching /proc parser.

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