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,13 +44,11 @@ Schema:
|
||||
"column_name2": string,
|
||||
|
||||
# below object only exists if using -qq or ignore_exceptions=True
|
||||
|
||||
"_jc_meta":
|
||||
{
|
||||
"success": boolean, # false if error parsing
|
||||
"error": string, # exists if "success" is false
|
||||
"line": string # exists if "success" is false
|
||||
}
|
||||
"_jc_meta": {
|
||||
"success": boolean, # false if error parsing
|
||||
"error": string, # exists if "success" is false
|
||||
"line": string # exists if "success" is false
|
||||
}
|
||||
}
|
||||
|
||||
Examples:
|
||||
|
@ -83,14 +83,12 @@ Schema:
|
||||
"percent_rrqm": float,
|
||||
"percent_wrqm": float,
|
||||
|
||||
# Below object only exists if using -qq or ignore_exceptions=True
|
||||
|
||||
"_jc_meta":
|
||||
{
|
||||
"success": boolean, # false if error parsing
|
||||
"error": string, # exists if "success" is false
|
||||
"line": string # exists if "success" is false
|
||||
}
|
||||
# below object only exists if using -qq or ignore_exceptions=True
|
||||
"_jc_meta": {
|
||||
"success": boolean, # false if error parsing
|
||||
"error": string, # exists if "success" is false
|
||||
"line": string # exists if "success" is false
|
||||
}
|
||||
}
|
||||
|
||||
Examples:
|
||||
|
@ -54,14 +54,12 @@ Schema:
|
||||
"epoch": integer, # [0]
|
||||
"epoch_utc": integer, # [1]
|
||||
|
||||
# Below object only exists if using -qq or ignore_exceptions=True
|
||||
|
||||
"_jc_meta":
|
||||
{
|
||||
"success": boolean, # false if error parsing
|
||||
"error": string, # exists if "success" is false
|
||||
"line": string # exists if "success" is false
|
||||
}
|
||||
# below object only exists if using -qq or ignore_exceptions=True
|
||||
"_jc_meta": {
|
||||
"success": boolean, # false if error parsing
|
||||
"error": string, # exists if "success" is false
|
||||
"line": string # exists if "success" is false
|
||||
}
|
||||
}
|
||||
|
||||
[0] naive timestamp if date field exists and can be converted.
|
||||
|
@ -7,7 +7,8 @@ jc - JSON Convert `pidstat` command output streaming parser
|
||||
|
||||
> 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):
|
||||
|
||||
@ -32,26 +33,48 @@ Usage (module):
|
||||
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
|
||||
|
||||
"_jc_meta":
|
||||
{
|
||||
"success": boolean, # false if error parsing
|
||||
"error": string, # exists if "success" is false
|
||||
"line": string # exists if "success" is false
|
||||
}
|
||||
# below object only exists if using -qq or ignore_exceptions=True
|
||||
"_jc_meta": {
|
||||
"success": boolean, # false if error parsing
|
||||
"error": string, # exists if "success" is false
|
||||
"line": string # exists if "success" is false
|
||||
}
|
||||
}
|
||||
|
||||
Examples:
|
||||
|
||||
$ pidstat | jc --pidstat-s
|
||||
{example output}
|
||||
$ pidstat -hl | jc --pidstat-s
|
||||
{"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
|
||||
{example output}
|
||||
$ pidstat -hl | jc --pidstat-s -r
|
||||
{"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>
|
||||
|
@ -61,14 +61,12 @@ Schema:
|
||||
"round_trip_ms_max": float,
|
||||
"round_trip_ms_stddev": float,
|
||||
|
||||
# Below object only exists if using -qq or ignore_exceptions=True
|
||||
|
||||
"_jc_meta":
|
||||
{
|
||||
"success": boolean, # false if error parsing
|
||||
"error": string, # exists if "success" is false
|
||||
"line": string # exists if "success" is false
|
||||
}
|
||||
# below object only exists if using -qq or ignore_exceptions=True
|
||||
"_jc_meta": {
|
||||
"success": boolean, # false if error parsing
|
||||
"error": string, # exists if "success" is false
|
||||
"line": string # exists if "success" is false
|
||||
}
|
||||
}
|
||||
|
||||
[0] 'reply', 'timeout', 'summary', etc. See `_error_type.type_map`
|
||||
|
@ -68,14 +68,12 @@ Schema:
|
||||
"extended_attribute_different": bool/null,
|
||||
"epoch": integer, [2]
|
||||
|
||||
# Below object only exists if using -qq or ignore_exceptions=True
|
||||
|
||||
"_jc_meta":
|
||||
{
|
||||
"success": boolean, # false if error parsing
|
||||
"error": string, # exists if "success" is false
|
||||
"line": string # exists if "success" is false
|
||||
}
|
||||
# below object only exists if using -qq or ignore_exceptions=True
|
||||
"_jc_meta": {
|
||||
"success": boolean, # false if error parsing
|
||||
"error": string, # exists if "success" is false
|
||||
"line": string # exists if "success" is false
|
||||
}
|
||||
}
|
||||
|
||||
[0] 'file sent', 'file received', 'local change or creation',
|
||||
|
@ -68,14 +68,12 @@ Schema:
|
||||
"block_size": integer,
|
||||
"unix_flags": string,
|
||||
|
||||
# Below object only exists if using -qq or ignore_exceptions=True
|
||||
|
||||
"_jc_meta":
|
||||
{
|
||||
"success": boolean, # false if error parsing
|
||||
"error": string, # exists if "success" is false
|
||||
"line": string # exists if "success" is false
|
||||
}
|
||||
# below object only exists if using -qq or ignore_exceptions=True
|
||||
"_jc_meta": {
|
||||
"success": boolean, # false if error parsing
|
||||
"error": string, # exists if "success" is false
|
||||
"line": string # exists if "success" is false
|
||||
}
|
||||
}
|
||||
|
||||
Examples:
|
||||
|
@ -80,14 +80,12 @@ Schema:
|
||||
"epoch": integer, # [0]
|
||||
"epoch_utc": integer # [1]
|
||||
|
||||
# Below object only exists if using -qq or ignore_exceptions=True
|
||||
|
||||
"_jc_meta":
|
||||
{
|
||||
"success": boolean, # [2]
|
||||
"error": string, # [3]
|
||||
"line": string # [3]
|
||||
}
|
||||
# below object only exists if using -qq or ignore_exceptions=True
|
||||
"_jc_meta": {
|
||||
"success": boolean, # [2]
|
||||
"error": string, # [3]
|
||||
"line": string # [3]
|
||||
}
|
||||
}
|
||||
|
||||
[0] naive timestamp if -t flag is used
|
||||
|
@ -39,13 +39,11 @@ Schema:
|
||||
"column_name2": string,
|
||||
|
||||
# below object only exists if using -qq or ignore_exceptions=True
|
||||
|
||||
"_jc_meta":
|
||||
{
|
||||
"success": boolean, # false if error parsing
|
||||
"error": string, # exists if "success" is false
|
||||
"line": string # exists if "success" is false
|
||||
}
|
||||
"_jc_meta": {
|
||||
"success": boolean, # false if error parsing
|
||||
"error": string, # exists if "success" is false
|
||||
"line": string # exists if "success" is false
|
||||
}
|
||||
}
|
||||
|
||||
Examples:
|
||||
|
@ -29,14 +29,12 @@ Schema:
|
||||
{
|
||||
"foo": string,
|
||||
|
||||
# Below object only exists if using -qq or ignore_exceptions=True
|
||||
|
||||
"_jc_meta":
|
||||
{
|
||||
"success": boolean, # false if error parsing
|
||||
"error": string, # exists if "success" is false
|
||||
"line": string # exists if "success" is false
|
||||
}
|
||||
# below object only exists if using -qq or ignore_exceptions=True
|
||||
"_jc_meta": {
|
||||
"success": boolean, # false if error parsing
|
||||
"error": string, # exists if "success" is false
|
||||
"line": string # exists if "success" is false
|
||||
}
|
||||
}
|
||||
|
||||
Examples:
|
||||
|
@ -78,14 +78,12 @@ Schema:
|
||||
"percent_rrqm": float,
|
||||
"percent_wrqm": float,
|
||||
|
||||
# Below object only exists if using -qq or ignore_exceptions=True
|
||||
|
||||
"_jc_meta":
|
||||
{
|
||||
"success": boolean, # false if error parsing
|
||||
"error": string, # exists if "success" is false
|
||||
"line": string # exists if "success" is false
|
||||
}
|
||||
# below object only exists if using -qq or ignore_exceptions=True
|
||||
"_jc_meta": {
|
||||
"success": boolean, # false if error parsing
|
||||
"error": string, # exists if "success" is false
|
||||
"line": string # exists if "success" is false
|
||||
}
|
||||
}
|
||||
|
||||
Examples:
|
||||
|
@ -49,14 +49,12 @@ Schema:
|
||||
"epoch": integer, # [0]
|
||||
"epoch_utc": integer, # [1]
|
||||
|
||||
# Below object only exists if using -qq or ignore_exceptions=True
|
||||
|
||||
"_jc_meta":
|
||||
{
|
||||
"success": boolean, # false if error parsing
|
||||
"error": string, # exists if "success" is false
|
||||
"line": string # exists if "success" is false
|
||||
}
|
||||
# below object only exists if using -qq or ignore_exceptions=True
|
||||
"_jc_meta": {
|
||||
"success": boolean, # false if error parsing
|
||||
"error": string, # exists if "success" is false
|
||||
"line": string # exists if "success" is false
|
||||
}
|
||||
}
|
||||
|
||||
[0] naive timestamp if date field exists and can be converted.
|
||||
|
@ -2,7 +2,8 @@
|
||||
|
||||
> 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):
|
||||
|
||||
@ -27,26 +28,48 @@ Usage (module):
|
||||
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
|
||||
|
||||
"_jc_meta":
|
||||
{
|
||||
"success": boolean, # false if error parsing
|
||||
"error": string, # exists if "success" is false
|
||||
"line": string # exists if "success" is false
|
||||
}
|
||||
# below object only exists if using -qq or ignore_exceptions=True
|
||||
"_jc_meta": {
|
||||
"success": boolean, # false if error parsing
|
||||
"error": string, # exists if "success" is false
|
||||
"line": string # exists if "success" is false
|
||||
}
|
||||
}
|
||||
|
||||
Examples:
|
||||
|
||||
$ pidstat | jc --pidstat-s
|
||||
{example output}
|
||||
$ pidstat -hl | jc --pidstat-s
|
||||
{"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
|
||||
{example output}
|
||||
$ pidstat -hl | jc --pidstat-s -r
|
||||
{"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
|
||||
|
@ -56,14 +56,12 @@ Schema:
|
||||
"round_trip_ms_max": float,
|
||||
"round_trip_ms_stddev": float,
|
||||
|
||||
# Below object only exists if using -qq or ignore_exceptions=True
|
||||
|
||||
"_jc_meta":
|
||||
{
|
||||
"success": boolean, # false if error parsing
|
||||
"error": string, # exists if "success" is false
|
||||
"line": string # exists if "success" is false
|
||||
}
|
||||
# below object only exists if using -qq or ignore_exceptions=True
|
||||
"_jc_meta": {
|
||||
"success": boolean, # false if error parsing
|
||||
"error": string, # exists if "success" is false
|
||||
"line": string # exists if "success" is false
|
||||
}
|
||||
}
|
||||
|
||||
[0] 'reply', 'timeout', 'summary', etc. See `_error_type.type_map`
|
||||
|
@ -63,14 +63,12 @@ Schema:
|
||||
"extended_attribute_different": bool/null,
|
||||
"epoch": integer, [2]
|
||||
|
||||
# Below object only exists if using -qq or ignore_exceptions=True
|
||||
|
||||
"_jc_meta":
|
||||
{
|
||||
"success": boolean, # false if error parsing
|
||||
"error": string, # exists if "success" is false
|
||||
"line": string # exists if "success" is false
|
||||
}
|
||||
# below object only exists if using -qq or ignore_exceptions=True
|
||||
"_jc_meta": {
|
||||
"success": boolean, # false if error parsing
|
||||
"error": string, # exists if "success" is false
|
||||
"line": string # exists if "success" is false
|
||||
}
|
||||
}
|
||||
|
||||
[0] 'file sent', 'file received', 'local change or creation',
|
||||
|
@ -63,14 +63,12 @@ Schema:
|
||||
"block_size": integer,
|
||||
"unix_flags": string,
|
||||
|
||||
# Below object only exists if using -qq or ignore_exceptions=True
|
||||
|
||||
"_jc_meta":
|
||||
{
|
||||
"success": boolean, # false if error parsing
|
||||
"error": string, # exists if "success" is false
|
||||
"line": string # exists if "success" is false
|
||||
}
|
||||
# below object only exists if using -qq or ignore_exceptions=True
|
||||
"_jc_meta": {
|
||||
"success": boolean, # false if error parsing
|
||||
"error": string, # exists if "success" is false
|
||||
"line": string # exists if "success" is false
|
||||
}
|
||||
}
|
||||
|
||||
Examples:
|
||||
|
@ -75,14 +75,12 @@ Schema:
|
||||
"epoch": integer, # [0]
|
||||
"epoch_utc": integer # [1]
|
||||
|
||||
# Below object only exists if using -qq or ignore_exceptions=True
|
||||
|
||||
"_jc_meta":
|
||||
{
|
||||
"success": boolean, # [2]
|
||||
"error": string, # [3]
|
||||
"line": string # [3]
|
||||
}
|
||||
# below object only exists if using -qq or ignore_exceptions=True
|
||||
"_jc_meta": {
|
||||
"success": boolean, # [2]
|
||||
"error": string, # [3]
|
||||
"line": string # [3]
|
||||
}
|
||||
}
|
||||
|
||||
[0] naive timestamp if -t flag is used
|
||||
|
Reference in New Issue
Block a user