mirror of
https://github.com/kellyjonbrazil/jc.git
synced 2025-07-17 01:32:37 +02:00
fix indentation for int and float conversions. add real_time field to schema
This commit is contained in:
@ -108,6 +108,7 @@ Returns:
|
|||||||
https://man7.org/linux/man-pages/man1/time.1.html
|
https://man7.org/linux/man-pages/man1/time.1.html
|
||||||
|
|
||||||
{
|
{
|
||||||
|
"real_time": float,
|
||||||
"user_time": float,
|
"user_time": float,
|
||||||
"system_time": float,
|
"system_time": float,
|
||||||
"elapsed_time": string,
|
"elapsed_time": string,
|
||||||
|
@ -113,6 +113,7 @@ def process(proc_data):
|
|||||||
https://man7.org/linux/man-pages/man1/time.1.html
|
https://man7.org/linux/man-pages/man1/time.1.html
|
||||||
|
|
||||||
{
|
{
|
||||||
|
"real_time": float,
|
||||||
"user_time": float,
|
"user_time": float,
|
||||||
"system_time": float,
|
"system_time": float,
|
||||||
"elapsed_time": string,
|
"elapsed_time": string,
|
||||||
@ -167,27 +168,27 @@ def process(proc_data):
|
|||||||
(proc_data['elapsed_time_seconds']) + \
|
(proc_data['elapsed_time_seconds']) + \
|
||||||
(proc_data['elapsed_time_centiseconds'] / 100)
|
(proc_data['elapsed_time_centiseconds'] / 100)
|
||||||
|
|
||||||
int_list = ['elapsed_time_hours', 'elapsed_time_minutes', 'elapsed_time_seconds', 'elapsed_time_microseconds',
|
int_list = ['elapsed_time_hours', 'elapsed_time_minutes', 'elapsed_time_seconds', 'elapsed_time_microseconds',
|
||||||
'cpu_percent', 'average_shared_text_size', 'average_unshared_data_size', 'average_unshared_stack_size',
|
'cpu_percent', 'average_shared_text_size', 'average_unshared_data_size', 'average_unshared_stack_size',
|
||||||
'average_shared_memory_size', 'maximum_resident_set_size', 'block_input_operations',
|
'average_shared_memory_size', 'maximum_resident_set_size', 'block_input_operations',
|
||||||
'block_output_operations', 'major_pagefaults', 'minor_pagefaults', 'swaps', 'page_reclaims',
|
'block_output_operations', 'major_pagefaults', 'minor_pagefaults', 'swaps', 'page_reclaims',
|
||||||
'page_faults', 'messages_sent', 'messages_received', 'signals_received', 'voluntary_context_switches',
|
'page_faults', 'messages_sent', 'messages_received', 'signals_received', 'voluntary_context_switches',
|
||||||
'involuntary_context_switches', 'average_stack_size', 'average_total_size', 'average_resident_set_size',
|
'involuntary_context_switches', 'average_stack_size', 'average_total_size', 'average_resident_set_size',
|
||||||
'signals_delivered', 'page_size', 'exit_status']
|
'signals_delivered', 'page_size', 'exit_status']
|
||||||
for key in int_list:
|
for key in int_list:
|
||||||
if key in proc_data:
|
if key in proc_data:
|
||||||
try:
|
try:
|
||||||
proc_data[key] = int(proc_data[key])
|
proc_data[key] = int(proc_data[key])
|
||||||
except (ValueError):
|
except (ValueError):
|
||||||
proc_data[key] = None
|
proc_data[key] = None
|
||||||
|
|
||||||
float_list = ['user_time', 'system_time']
|
float_list = ['real_time', 'user_time', 'system_time']
|
||||||
for key in float_list:
|
for key in float_list:
|
||||||
if key in proc_data:
|
if key in proc_data:
|
||||||
try:
|
try:
|
||||||
proc_data[key] = float(proc_data[key])
|
proc_data[key] = float(proc_data[key])
|
||||||
except (ValueError):
|
except (ValueError):
|
||||||
proc_data[key] = None
|
proc_data[key] = None
|
||||||
|
|
||||||
return proc_data
|
return proc_data
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user