1
0
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:
Kelly Brazil
2022-03-10 10:10:57 -08:00
parent b9365e2ac2
commit a5fb8fbf94
17 changed files with 162 additions and 146 deletions

View File

@ -44,9 +44,7 @@ Schema:
"column_name2": string,
# below object only exists if using -qq or ignore_exceptions=True
"_jc_meta":
{
"_jc_meta": {
"success": boolean, # false if error parsing
"error": string, # exists if "success" is false
"line": string # exists if "success" is false

View File

@ -83,10 +83,8 @@ Schema:
"percent_rrqm": float,
"percent_wrqm": float,
# Below object only exists if using -qq or ignore_exceptions=True
"_jc_meta":
{
# 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

View File

@ -54,10 +54,8 @@ Schema:
"epoch": integer, # [0]
"epoch_utc": integer, # [1]
# Below object only exists if using -qq or ignore_exceptions=True
"_jc_meta":
{
# 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

View File

@ -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,12 +33,30 @@ 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":
{
# 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
@ -46,12 +65,16 @@ Schema:
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>

View File

@ -61,10 +61,8 @@ Schema:
"round_trip_ms_max": float,
"round_trip_ms_stddev": float,
# Below object only exists if using -qq or ignore_exceptions=True
"_jc_meta":
{
# 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

View File

@ -68,10 +68,8 @@ Schema:
"extended_attribute_different": bool/null,
"epoch": integer, [2]
# Below object only exists if using -qq or ignore_exceptions=True
"_jc_meta":
{
# 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

View File

@ -68,10 +68,8 @@ Schema:
"block_size": integer,
"unix_flags": string,
# Below object only exists if using -qq or ignore_exceptions=True
"_jc_meta":
{
# 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

View File

@ -80,10 +80,8 @@ Schema:
"epoch": integer, # [0]
"epoch_utc": integer # [1]
# Below object only exists if using -qq or ignore_exceptions=True
"_jc_meta":
{
# below object only exists if using -qq or ignore_exceptions=True
"_jc_meta": {
"success": boolean, # [2]
"error": string, # [3]
"line": string # [3]

View File

@ -39,9 +39,7 @@ Schema:
"column_name2": string,
# below object only exists if using -qq or ignore_exceptions=True
"_jc_meta":
{
"_jc_meta": {
"success": boolean, # false if error parsing
"error": string, # exists if "success" is false
"line": string # exists if "success" is false

View File

@ -29,10 +29,8 @@ Schema:
{
"foo": string,
# Below object only exists if using -qq or ignore_exceptions=True
"_jc_meta":
{
# 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

View File

@ -78,10 +78,8 @@ Schema:
"percent_rrqm": float,
"percent_wrqm": float,
# Below object only exists if using -qq or ignore_exceptions=True
"_jc_meta":
{
# 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

View File

@ -49,10 +49,8 @@ Schema:
"epoch": integer, # [0]
"epoch_utc": integer, # [1]
# Below object only exists if using -qq or ignore_exceptions=True
"_jc_meta":
{
# 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

View File

@ -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,12 +28,30 @@ 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":
{
# 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
@ -41,12 +60,16 @@ Schema:
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

View File

@ -56,10 +56,8 @@ Schema:
"round_trip_ms_max": float,
"round_trip_ms_stddev": float,
# Below object only exists if using -qq or ignore_exceptions=True
"_jc_meta":
{
# 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

View File

@ -63,10 +63,8 @@ Schema:
"extended_attribute_different": bool/null,
"epoch": integer, [2]
# Below object only exists if using -qq or ignore_exceptions=True
"_jc_meta":
{
# 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

View File

@ -63,10 +63,8 @@ Schema:
"block_size": integer,
"unix_flags": string,
# Below object only exists if using -qq or ignore_exceptions=True
"_jc_meta":
{
# 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

View File

@ -75,10 +75,8 @@ Schema:
"epoch": integer, # [0]
"epoch_utc": integer # [1]
# Below object only exists if using -qq or ignore_exceptions=True
"_jc_meta":
{
# below object only exists if using -qq or ignore_exceptions=True
"_jc_meta": {
"success": boolean, # [2]
"error": string, # [3]
"line": string # [3]