1
0
mirror of https://github.com/kellyjonbrazil/jc.git synced 2025-06-17 00:07:37 +02:00
Files
jc/docs/parsers/proc_softirqs.md

88 lines
1.5 KiB
Markdown
Raw Normal View History

2022-09-16 14:50:14 -07:00
[Home](https://kellyjonbrazil.github.io/jc/)
<a id="jc.parsers.proc_softirqs"></a>
2024-03-14 22:46:52 -07:00
# jc.parsers.proc_softirqs
2022-09-16 14:50:14 -07:00
jc - JSON Convert `/proc/softirqs` file parser
Usage (cli):
$ cat /proc/softirqs | jc --proc
or
$ jc /proc/softirqs
or
$ cat /proc/softirqs | jc --proc-softirqs
Usage (module):
import jc
result = jc.parse('proc', proc_softirqs_file)
or
import jc
result = jc.parse('proc_softirqs', proc_softirqs_file)
Schema:
[
{
"counter": string,
"CPU<number>": integer,
}
]
Examples:
$ cat /proc/softirqs | jc --proc -p
[
{
"counter": "HI",
"CPU0": 1,
"CPU1": 34056,
"CPU2": 0,
"CPU3": 0,
"CPU4": 0
},
{
"counter": "TIMER",
"CPU0": 322970,
"CPU1": 888166,
"CPU2": 0,
"CPU3": 0,
"CPU4": 0
},
...
]
<a id="jc.parsers.proc_softirqs.parse"></a>
### parse
```python
def parse(data: str, raw: bool = False, quiet: bool = False) -> List[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:
List of Dictionaries. Raw or processed structured data.
### Parser Information
Compatibility: linux
2023-12-21 14:55:21 -08:00
Source: [`jc/parsers/proc_softirqs.py`](https://github.com/kellyjonbrazil/jc/blob/master/jc/parsers/proc_softirqs.py)
2022-09-16 14:50:14 -07:00
Version 1.0 by Kelly Brazil (kellyjonbrazil@gmail.com)