mirror of
https://github.com/vale981/jobmanager
synced 2025-03-04 17:31:39 -05:00
added per job time statistics to JM client
This commit is contained in:
parent
a3542b7f6c
commit
f633e7c550
2 changed files with 19 additions and 19 deletions
|
@ -396,7 +396,7 @@ class JobManager_Client(object):
|
|||
|
||||
# regular case, just stop working when empty job_q was found
|
||||
except queue.Empty:
|
||||
if verbose > 1:
|
||||
if verbose > 0:
|
||||
print("{}: finds empty job queue, processed {} jobs".format(identifier, cnt))
|
||||
break
|
||||
# handle SystemExit in outer try ... except
|
||||
|
@ -511,7 +511,7 @@ class JobManager_Client(object):
|
|||
|
||||
if verbose > 0:
|
||||
try:
|
||||
print("{}: pure calculation time: {}".format(identifier, progress.humanize_time(time_calc) ))
|
||||
print("{}: pure calculation time: {} single task average: {}".format(identifier, progress.humanize_time(time_calc), progress.humanize_time(time_calc / cnt) ))
|
||||
print("{}: calculation:{:.2%} communication:{:.2%}".format(identifier, time_calc/(time_calc+time_queue), time_queue/(time_calc+time_queue)))
|
||||
except:
|
||||
pass
|
||||
|
@ -607,7 +607,7 @@ class JobManager_Client(object):
|
|||
while p.is_alive():
|
||||
if self.verbose > 2:
|
||||
print("{}: still alive {} PID {}".format(self._identifier, p, p.pid))
|
||||
p.join(timeout=1)
|
||||
p.join(timeout=self.interval)
|
||||
|
||||
if self.verbose > 2:
|
||||
print("{}: process {} PID {} was joined".format(self._identifier, p, p.pid))
|
||||
|
@ -1528,12 +1528,12 @@ def proxy_operation_decorator_python3(proxy, operation, verbose=1, identifier=''
|
|||
res = o(*args, **kwargs)
|
||||
|
||||
except Exception as e:
|
||||
if verbose > 0:
|
||||
if verbose > 1:
|
||||
print("{}operation '{}' -> {} FAILED due to '{}'".format(identifier, operation, dest, type(e)))
|
||||
print(traceback.format_stack()[-3].strip())
|
||||
|
||||
if type(e) is ConnectionResetError:
|
||||
if verbose > 0:
|
||||
if verbose > 1:
|
||||
traceback.print_exc(limit=1)
|
||||
print("{}try to reconnect".format(identifier))
|
||||
call_connect(proxy._connect, dest, verbose, identifier, reconnect_wait, reconnect_tries)
|
||||
|
|
|
@ -883,22 +883,22 @@ if __name__ == "__main__":
|
|||
pass
|
||||
else:
|
||||
func = [
|
||||
test_Signal_to_SIG_IGN,
|
||||
test_Signal_to_sys_exit,
|
||||
test_Signal_to_terminate_process_list,
|
||||
# test_Signal_to_SIG_IGN,
|
||||
# test_Signal_to_sys_exit,
|
||||
# test_Signal_to_terminate_process_list,
|
||||
|
||||
test_jobmanager_basic,
|
||||
test_jobmanager_server_signals,
|
||||
test_shutdown_server_while_client_running,
|
||||
test_shutdown_client,
|
||||
test_check_fail,
|
||||
test_jobmanager_read_old_stat,
|
||||
# test_jobmanager_basic,
|
||||
# test_jobmanager_server_signals,
|
||||
# test_shutdown_server_while_client_running,
|
||||
# test_shutdown_client,
|
||||
# test_check_fail,
|
||||
# test_jobmanager_read_old_stat,
|
||||
test_client_status,
|
||||
test_jobmanager_local,
|
||||
test_start_server_on_used_port,
|
||||
test_shared_const_arg,
|
||||
test_digest_rejected,
|
||||
test_exception,
|
||||
# test_jobmanager_local,
|
||||
# test_start_server_on_used_port,
|
||||
# test_shared_const_arg,
|
||||
# test_digest_rejected,
|
||||
# test_exception,
|
||||
|
||||
lambda : print("END")
|
||||
]
|
||||
|
|
Loading…
Add table
Reference in a new issue