mirror of
https://github.com/kellyjonbrazil/jc.git
synced 2025-06-17 00:07:37 +02:00
fix process conversions
This commit is contained in:
@ -1,7 +1,8 @@
|
|||||||
"""jc - JSON CLI output utility `rsync` command output parser
|
"""jc - JSON CLI output utility `rsync` command output parser
|
||||||
|
|
||||||
Supports the `-i` or `--itemize-changes` option with all levels of
|
Supports the following options with all levels of verbosity:
|
||||||
verbosity.
|
- `-i` or `--itemize-changes`
|
||||||
|
- `--log-file`
|
||||||
|
|
||||||
Usage (cli):
|
Usage (cli):
|
||||||
|
|
||||||
@ -31,7 +32,13 @@ Schema:
|
|||||||
"process": integer, # need to convert
|
"process": integer, # need to convert
|
||||||
"sent": integer, # need to convert
|
"sent": integer, # need to convert
|
||||||
"received": integer, # need to convert
|
"received": integer, # need to convert
|
||||||
"total_size": integer # need to convert
|
"total_size": integer, # need to convert
|
||||||
|
"matches": integer, # need to convert
|
||||||
|
"hash_hits": integer, # need to convert
|
||||||
|
"false_alarms": integer, # need to convert
|
||||||
|
"data": integer?, # need to convert
|
||||||
|
"bytes_sec": float, # need to convert
|
||||||
|
"speedup": float # need to convert
|
||||||
},
|
},
|
||||||
"files": [
|
"files": [
|
||||||
"filename": string,
|
"filename": string,
|
||||||
@ -46,12 +53,7 @@ Schema:
|
|||||||
"group_different": bool/null,
|
"group_different": bool/null,
|
||||||
"future": null,
|
"future": null,
|
||||||
"acl_different": bool/null,
|
"acl_different": bool/null,
|
||||||
"extended_attribute_different": bool/null,
|
"extended_attribute_different": bool/null
|
||||||
"sent": integer, # need to convert
|
|
||||||
"received": integer, # need to convert
|
|
||||||
"bytes_sec": float, # need to convert
|
|
||||||
"total_size": integer, # need to convert
|
|
||||||
"speedup": float, # need to convert
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
@ -95,14 +97,14 @@ def _process(proc_data: List[Dict]) -> List[Dict]:
|
|||||||
|
|
||||||
List of Dictionaries. Structured to conform to the schema.
|
List of Dictionaries. Structured to conform to the schema.
|
||||||
"""
|
"""
|
||||||
# int_list = ['sent', 'received', 'total_size']
|
int_list = ['process', 'sent', 'received', 'total_size', 'matches', 'has_hits', 'false_alarms', 'data']
|
||||||
# float_list = ['bytes_sec', 'speedup']
|
float_list = ['bytes_sec', 'speedup']
|
||||||
# for entry in proc_data:
|
for item in proc_data:
|
||||||
# for key in entry:
|
for key in item['summary']:
|
||||||
# if key in int_list:
|
if key in int_list:
|
||||||
# entry[key] = jc.utils.convert_to_int(entry[key])
|
item['summary'][key] = jc.utils.convert_to_int(item['summary'][key])
|
||||||
# if key in float_list:
|
if key in float_list:
|
||||||
# entry[key] = jc.utils.convert_to_float(entry[key])
|
item['summary'][key] = jc.utils.convert_to_float(item['summary'][key])
|
||||||
|
|
||||||
return proc_data
|
return proc_data
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user