mirror of
https://github.com/kellyjonbrazil/jc.git
synced 2025-06-17 00:07:37 +02:00
streaming doc update
This commit is contained in:
@ -44,9 +44,7 @@ Schema:
|
|||||||
"column_name2": string,
|
"column_name2": string,
|
||||||
|
|
||||||
# below object only exists if using -qq or ignore_exceptions=True
|
# below object only exists if using -qq or ignore_exceptions=True
|
||||||
|
"_jc_meta": {
|
||||||
"_jc_meta":
|
|
||||||
{
|
|
||||||
"success": boolean, # false if error parsing
|
"success": boolean, # false if error parsing
|
||||||
"error": string, # exists if "success" is false
|
"error": string, # exists if "success" is false
|
||||||
"line": string # exists if "success" is false
|
"line": string # exists if "success" is false
|
||||||
|
@ -83,10 +83,8 @@ Schema:
|
|||||||
"percent_rrqm": float,
|
"percent_rrqm": float,
|
||||||
"percent_wrqm": float,
|
"percent_wrqm": float,
|
||||||
|
|
||||||
# Below object only exists if using -qq or ignore_exceptions=True
|
# below object only exists if using -qq or ignore_exceptions=True
|
||||||
|
"_jc_meta": {
|
||||||
"_jc_meta":
|
|
||||||
{
|
|
||||||
"success": boolean, # false if error parsing
|
"success": boolean, # false if error parsing
|
||||||
"error": string, # exists if "success" is false
|
"error": string, # exists if "success" is false
|
||||||
"line": string # exists if "success" is false
|
"line": string # exists if "success" is false
|
||||||
|
@ -54,10 +54,8 @@ Schema:
|
|||||||
"epoch": integer, # [0]
|
"epoch": integer, # [0]
|
||||||
"epoch_utc": integer, # [1]
|
"epoch_utc": integer, # [1]
|
||||||
|
|
||||||
# Below object only exists if using -qq or ignore_exceptions=True
|
# below object only exists if using -qq or ignore_exceptions=True
|
||||||
|
"_jc_meta": {
|
||||||
"_jc_meta":
|
|
||||||
{
|
|
||||||
"success": boolean, # false if error parsing
|
"success": boolean, # false if error parsing
|
||||||
"error": string, # exists if "success" is false
|
"error": string, # exists if "success" is false
|
||||||
"line": string # exists if "success" is false
|
"line": string # exists if "success" is false
|
||||||
|
@ -7,7 +7,8 @@ jc - JSON Convert `pidstat` command output streaming parser
|
|||||||
|
|
||||||
> This streaming parser outputs JSON Lines
|
> This streaming parser outputs JSON Lines
|
||||||
|
|
||||||
<<Short pidstat description and caveats>>
|
Must use the `-h` option in `pidstat`. All other `pidstat` options are
|
||||||
|
supported in combination with `-h`.
|
||||||
|
|
||||||
Usage (cli):
|
Usage (cli):
|
||||||
|
|
||||||
@ -32,12 +33,30 @@ Usage (module):
|
|||||||
Schema:
|
Schema:
|
||||||
|
|
||||||
{
|
{
|
||||||
"pidstat": string,
|
"time": integer,
|
||||||
|
"uid": integer,
|
||||||
|
"pid": integer,
|
||||||
|
"percent_usr": float,
|
||||||
|
"percent_system": float,
|
||||||
|
"percent_guest": float,
|
||||||
|
"percent_cpu": float,
|
||||||
|
"cpu": integer,
|
||||||
|
"minflt_s": float,
|
||||||
|
"majflt_s": float,
|
||||||
|
"vsz": integer,
|
||||||
|
"rss": integer,
|
||||||
|
"percent_mem": float,
|
||||||
|
"stksize": integer,
|
||||||
|
"stkref": integer,
|
||||||
|
"kb_rd_s": float,
|
||||||
|
"kb_wr_s": float,
|
||||||
|
"kb_ccwr_s": float,
|
||||||
|
"cswch_s": float,
|
||||||
|
"nvcswch_s": float,
|
||||||
|
"command": string,
|
||||||
|
|
||||||
# Below object only exists if using -qq or ignore_exceptions=True
|
# below object only exists if using -qq or ignore_exceptions=True
|
||||||
|
"_jc_meta": {
|
||||||
"_jc_meta":
|
|
||||||
{
|
|
||||||
"success": boolean, # false if error parsing
|
"success": boolean, # false if error parsing
|
||||||
"error": string, # exists if "success" is false
|
"error": string, # exists if "success" is false
|
||||||
"line": string # exists if "success" is false
|
"line": string # exists if "success" is false
|
||||||
@ -46,12 +65,16 @@ Schema:
|
|||||||
|
|
||||||
Examples:
|
Examples:
|
||||||
|
|
||||||
$ pidstat | jc --pidstat-s
|
$ pidstat -hl | jc --pidstat-s
|
||||||
{example output}
|
{"time":1646859134,"uid":0,"pid":1,"percent_usr":0.0,"percent_system...}
|
||||||
|
{"time":1646859134,"uid":0,"pid":6,"percent_usr":0.0,"percent_system...}
|
||||||
|
{"time":1646859134,"uid":0,"pid":9,"percent_usr":0.0,"percent_system...}
|
||||||
...
|
...
|
||||||
|
|
||||||
$ pidstat | jc --pidstat-s -r
|
$ pidstat -hl | jc --pidstat-s -r
|
||||||
{example output}
|
{"time":"1646859134","uid":"0","pid":"1","percent_usr":"0.00","perc...}
|
||||||
|
{"time":"1646859134","uid":"0","pid":"6","percent_usr":"0.00","perc...}
|
||||||
|
{"time":"1646859134","uid":"0","pid":"9","percent_usr":"0.00","perc...}
|
||||||
...
|
...
|
||||||
|
|
||||||
<a id="jc.parsers.pidstat_s.parse"></a>
|
<a id="jc.parsers.pidstat_s.parse"></a>
|
||||||
|
@ -61,10 +61,8 @@ Schema:
|
|||||||
"round_trip_ms_max": float,
|
"round_trip_ms_max": float,
|
||||||
"round_trip_ms_stddev": float,
|
"round_trip_ms_stddev": float,
|
||||||
|
|
||||||
# Below object only exists if using -qq or ignore_exceptions=True
|
# below object only exists if using -qq or ignore_exceptions=True
|
||||||
|
"_jc_meta": {
|
||||||
"_jc_meta":
|
|
||||||
{
|
|
||||||
"success": boolean, # false if error parsing
|
"success": boolean, # false if error parsing
|
||||||
"error": string, # exists if "success" is false
|
"error": string, # exists if "success" is false
|
||||||
"line": string # exists if "success" is false
|
"line": string # exists if "success" is false
|
||||||
|
@ -68,10 +68,8 @@ Schema:
|
|||||||
"extended_attribute_different": bool/null,
|
"extended_attribute_different": bool/null,
|
||||||
"epoch": integer, [2]
|
"epoch": integer, [2]
|
||||||
|
|
||||||
# Below object only exists if using -qq or ignore_exceptions=True
|
# below object only exists if using -qq or ignore_exceptions=True
|
||||||
|
"_jc_meta": {
|
||||||
"_jc_meta":
|
|
||||||
{
|
|
||||||
"success": boolean, # false if error parsing
|
"success": boolean, # false if error parsing
|
||||||
"error": string, # exists if "success" is false
|
"error": string, # exists if "success" is false
|
||||||
"line": string # exists if "success" is false
|
"line": string # exists if "success" is false
|
||||||
|
@ -68,10 +68,8 @@ Schema:
|
|||||||
"block_size": integer,
|
"block_size": integer,
|
||||||
"unix_flags": string,
|
"unix_flags": string,
|
||||||
|
|
||||||
# Below object only exists if using -qq or ignore_exceptions=True
|
# below object only exists if using -qq or ignore_exceptions=True
|
||||||
|
"_jc_meta": {
|
||||||
"_jc_meta":
|
|
||||||
{
|
|
||||||
"success": boolean, # false if error parsing
|
"success": boolean, # false if error parsing
|
||||||
"error": string, # exists if "success" is false
|
"error": string, # exists if "success" is false
|
||||||
"line": string # exists if "success" is false
|
"line": string # exists if "success" is false
|
||||||
|
@ -80,10 +80,8 @@ Schema:
|
|||||||
"epoch": integer, # [0]
|
"epoch": integer, # [0]
|
||||||
"epoch_utc": integer # [1]
|
"epoch_utc": integer # [1]
|
||||||
|
|
||||||
# Below object only exists if using -qq or ignore_exceptions=True
|
# below object only exists if using -qq or ignore_exceptions=True
|
||||||
|
"_jc_meta": {
|
||||||
"_jc_meta":
|
|
||||||
{
|
|
||||||
"success": boolean, # [2]
|
"success": boolean, # [2]
|
||||||
"error": string, # [3]
|
"error": string, # [3]
|
||||||
"line": string # [3]
|
"line": string # [3]
|
||||||
|
@ -39,9 +39,7 @@ Schema:
|
|||||||
"column_name2": string,
|
"column_name2": string,
|
||||||
|
|
||||||
# below object only exists if using -qq or ignore_exceptions=True
|
# below object only exists if using -qq or ignore_exceptions=True
|
||||||
|
"_jc_meta": {
|
||||||
"_jc_meta":
|
|
||||||
{
|
|
||||||
"success": boolean, # false if error parsing
|
"success": boolean, # false if error parsing
|
||||||
"error": string, # exists if "success" is false
|
"error": string, # exists if "success" is false
|
||||||
"line": string # exists if "success" is false
|
"line": string # exists if "success" is false
|
||||||
|
@ -29,10 +29,8 @@ Schema:
|
|||||||
{
|
{
|
||||||
"foo": string,
|
"foo": string,
|
||||||
|
|
||||||
# Below object only exists if using -qq or ignore_exceptions=True
|
# below object only exists if using -qq or ignore_exceptions=True
|
||||||
|
"_jc_meta": {
|
||||||
"_jc_meta":
|
|
||||||
{
|
|
||||||
"success": boolean, # false if error parsing
|
"success": boolean, # false if error parsing
|
||||||
"error": string, # exists if "success" is false
|
"error": string, # exists if "success" is false
|
||||||
"line": string # exists if "success" is false
|
"line": string # exists if "success" is false
|
||||||
|
@ -78,10 +78,8 @@ Schema:
|
|||||||
"percent_rrqm": float,
|
"percent_rrqm": float,
|
||||||
"percent_wrqm": float,
|
"percent_wrqm": float,
|
||||||
|
|
||||||
# Below object only exists if using -qq or ignore_exceptions=True
|
# below object only exists if using -qq or ignore_exceptions=True
|
||||||
|
"_jc_meta": {
|
||||||
"_jc_meta":
|
|
||||||
{
|
|
||||||
"success": boolean, # false if error parsing
|
"success": boolean, # false if error parsing
|
||||||
"error": string, # exists if "success" is false
|
"error": string, # exists if "success" is false
|
||||||
"line": string # exists if "success" is false
|
"line": string # exists if "success" is false
|
||||||
|
@ -49,10 +49,8 @@ Schema:
|
|||||||
"epoch": integer, # [0]
|
"epoch": integer, # [0]
|
||||||
"epoch_utc": integer, # [1]
|
"epoch_utc": integer, # [1]
|
||||||
|
|
||||||
# Below object only exists if using -qq or ignore_exceptions=True
|
# below object only exists if using -qq or ignore_exceptions=True
|
||||||
|
"_jc_meta": {
|
||||||
"_jc_meta":
|
|
||||||
{
|
|
||||||
"success": boolean, # false if error parsing
|
"success": boolean, # false if error parsing
|
||||||
"error": string, # exists if "success" is false
|
"error": string, # exists if "success" is false
|
||||||
"line": string # exists if "success" is false
|
"line": string # exists if "success" is false
|
||||||
|
@ -2,7 +2,8 @@
|
|||||||
|
|
||||||
> This streaming parser outputs JSON Lines
|
> This streaming parser outputs JSON Lines
|
||||||
|
|
||||||
<<Short pidstat description and caveats>>
|
Must use the `-h` option in `pidstat`. All other `pidstat` options are
|
||||||
|
supported in combination with `-h`.
|
||||||
|
|
||||||
Usage (cli):
|
Usage (cli):
|
||||||
|
|
||||||
@ -27,12 +28,30 @@ Usage (module):
|
|||||||
Schema:
|
Schema:
|
||||||
|
|
||||||
{
|
{
|
||||||
"pidstat": string,
|
"time": integer,
|
||||||
|
"uid": integer,
|
||||||
|
"pid": integer,
|
||||||
|
"percent_usr": float,
|
||||||
|
"percent_system": float,
|
||||||
|
"percent_guest": float,
|
||||||
|
"percent_cpu": float,
|
||||||
|
"cpu": integer,
|
||||||
|
"minflt_s": float,
|
||||||
|
"majflt_s": float,
|
||||||
|
"vsz": integer,
|
||||||
|
"rss": integer,
|
||||||
|
"percent_mem": float,
|
||||||
|
"stksize": integer,
|
||||||
|
"stkref": integer,
|
||||||
|
"kb_rd_s": float,
|
||||||
|
"kb_wr_s": float,
|
||||||
|
"kb_ccwr_s": float,
|
||||||
|
"cswch_s": float,
|
||||||
|
"nvcswch_s": float,
|
||||||
|
"command": string,
|
||||||
|
|
||||||
# Below object only exists if using -qq or ignore_exceptions=True
|
# below object only exists if using -qq or ignore_exceptions=True
|
||||||
|
"_jc_meta": {
|
||||||
"_jc_meta":
|
|
||||||
{
|
|
||||||
"success": boolean, # false if error parsing
|
"success": boolean, # false if error parsing
|
||||||
"error": string, # exists if "success" is false
|
"error": string, # exists if "success" is false
|
||||||
"line": string # exists if "success" is false
|
"line": string # exists if "success" is false
|
||||||
@ -41,12 +60,16 @@ Schema:
|
|||||||
|
|
||||||
Examples:
|
Examples:
|
||||||
|
|
||||||
$ pidstat | jc --pidstat-s
|
$ pidstat -hl | jc --pidstat-s
|
||||||
{example output}
|
{"time":1646859134,"uid":0,"pid":1,"percent_usr":0.0,"percent_system...}
|
||||||
|
{"time":1646859134,"uid":0,"pid":6,"percent_usr":0.0,"percent_system...}
|
||||||
|
{"time":1646859134,"uid":0,"pid":9,"percent_usr":0.0,"percent_system...}
|
||||||
...
|
...
|
||||||
|
|
||||||
$ pidstat | jc --pidstat-s -r
|
$ pidstat -hl | jc --pidstat-s -r
|
||||||
{example output}
|
{"time":"1646859134","uid":"0","pid":"1","percent_usr":"0.00","perc...}
|
||||||
|
{"time":"1646859134","uid":"0","pid":"6","percent_usr":"0.00","perc...}
|
||||||
|
{"time":"1646859134","uid":"0","pid":"9","percent_usr":"0.00","perc...}
|
||||||
...
|
...
|
||||||
"""
|
"""
|
||||||
from typing import Dict, Iterable, Union
|
from typing import Dict, Iterable, Union
|
||||||
|
@ -56,10 +56,8 @@ Schema:
|
|||||||
"round_trip_ms_max": float,
|
"round_trip_ms_max": float,
|
||||||
"round_trip_ms_stddev": float,
|
"round_trip_ms_stddev": float,
|
||||||
|
|
||||||
# Below object only exists if using -qq or ignore_exceptions=True
|
# below object only exists if using -qq or ignore_exceptions=True
|
||||||
|
"_jc_meta": {
|
||||||
"_jc_meta":
|
|
||||||
{
|
|
||||||
"success": boolean, # false if error parsing
|
"success": boolean, # false if error parsing
|
||||||
"error": string, # exists if "success" is false
|
"error": string, # exists if "success" is false
|
||||||
"line": string # exists if "success" is false
|
"line": string # exists if "success" is false
|
||||||
|
@ -63,10 +63,8 @@ Schema:
|
|||||||
"extended_attribute_different": bool/null,
|
"extended_attribute_different": bool/null,
|
||||||
"epoch": integer, [2]
|
"epoch": integer, [2]
|
||||||
|
|
||||||
# Below object only exists if using -qq or ignore_exceptions=True
|
# below object only exists if using -qq or ignore_exceptions=True
|
||||||
|
"_jc_meta": {
|
||||||
"_jc_meta":
|
|
||||||
{
|
|
||||||
"success": boolean, # false if error parsing
|
"success": boolean, # false if error parsing
|
||||||
"error": string, # exists if "success" is false
|
"error": string, # exists if "success" is false
|
||||||
"line": string # exists if "success" is false
|
"line": string # exists if "success" is false
|
||||||
|
@ -63,10 +63,8 @@ Schema:
|
|||||||
"block_size": integer,
|
"block_size": integer,
|
||||||
"unix_flags": string,
|
"unix_flags": string,
|
||||||
|
|
||||||
# Below object only exists if using -qq or ignore_exceptions=True
|
# below object only exists if using -qq or ignore_exceptions=True
|
||||||
|
"_jc_meta": {
|
||||||
"_jc_meta":
|
|
||||||
{
|
|
||||||
"success": boolean, # false if error parsing
|
"success": boolean, # false if error parsing
|
||||||
"error": string, # exists if "success" is false
|
"error": string, # exists if "success" is false
|
||||||
"line": string # exists if "success" is false
|
"line": string # exists if "success" is false
|
||||||
|
@ -75,10 +75,8 @@ Schema:
|
|||||||
"epoch": integer, # [0]
|
"epoch": integer, # [0]
|
||||||
"epoch_utc": integer # [1]
|
"epoch_utc": integer # [1]
|
||||||
|
|
||||||
# Below object only exists if using -qq or ignore_exceptions=True
|
# below object only exists if using -qq or ignore_exceptions=True
|
||||||
|
"_jc_meta": {
|
||||||
"_jc_meta":
|
|
||||||
{
|
|
||||||
"success": boolean, # [2]
|
"success": boolean, # [2]
|
||||||
"error": string, # [3]
|
"error": string, # [3]
|
||||||
"line": string # [3]
|
"line": string # [3]
|
||||||
|
Reference in New Issue
Block a user