diff --git a/docs/parsers/proc_vmstat.md b/docs/parsers/proc_vmstat.md new file mode 100644 index 00000000..d1e6a098 --- /dev/null +++ b/docs/parsers/proc_vmstat.md @@ -0,0 +1,84 @@ +[Home](https://kellyjonbrazil.github.io/jc/) + + +# jc.parsers.proc\_vmstat + +jc - JSON Convert `/proc/vmstat` file parser + +Usage (cli): + + $ cat /proc/vmstat | jc --proc + +or + + $ jc /proc/vmstat + +or + + $ cat /proc/vmstat | jc --proc-vmstat + +Usage (module): + + import jc + result = jc.parse('proc', proc_vmstat_file) + +or + + import jc + result = jc.parse('proc_vmstat', proc_vmstat_file) + +Schema: + +All values are integers. + + { + integer + } + +Examples: + + $ cat /proc/vmstat | jc --proc -p + { + "nr_free_pages": 615337, + "nr_zone_inactive_anon": 39, + "nr_zone_active_anon": 34838, + "nr_zone_inactive_file": 104036, + "nr_zone_active_file": 130601, + "nr_zone_unevictable": 4897, + "nr_zone_write_pending": 45, + "nr_mlock": 4897, + "nr_page_table_pages": 548, + "nr_kernel_stack": 5984, + "nr_bounce": 0, + "nr_zspages": 0, + "nr_free_cma": 0, + "numa_hit": 1910597, + "numa_miss": 0, + "numa_foreign": 0, + ... + } + + + +### parse + +```python +def parse(data: str, raw: bool = False, quiet: bool = False) -> Dict +``` + +Main text parsing function + +Parameters: + + data: (string) text data to parse + raw: (boolean) unprocessed output if True + quiet: (boolean) suppress warning messages if True + +Returns: + + Dictionary. Raw or processed structured data. + +### Parser Information +Compatibility: linux + +Version 1.0 by Kelly Brazil (kellyjonbrazil@gmail.com) diff --git a/jc/lib.py b/jc/lib.py index 88fa425a..a8777f9c 100644 --- a/jc/lib.py +++ b/jc/lib.py @@ -110,6 +110,7 @@ parsers = [ 'proc-uptime', 'proc-version', 'proc-vmallocinfo', + 'proc-vmstat', 'proc-pid-numa-maps', 'ps', 'route', diff --git a/man/jc.1 b/man/jc.1 index d29f7b9a..d679395c 100644 --- a/man/jc.1 +++ b/man/jc.1 @@ -535,6 +535,11 @@ PLIST file parser \fB--proc-vmallocinfo\fP `/proc/vmallocinfo` file parser +.TP +.B +\fB--proc-vmstat\fP +`/proc/vmstat` file parser + .TP .B \fB--proc-pid-numa-maps\fP