fix thanatolog

This commit is contained in:
Alexey Avramov 2019-06-30 23:00:03 +09:00
parent 76a9c02ea1
commit c87ec6a59b

View File

@ -124,6 +124,26 @@ send_signal = SIGKILL
# os.kill(int(pid), SIGCONT) # os.kill(int(pid), SIGCONT)
t0 = time()
for i in range(10):
rpe = os.path.exists('/proc/{}/exe'.format(pid))
rss = pid_to_rss(pid)
pe = os.path.exists('/proc/{}'.format(pid))
t1 = time()
d = t1 - t0
state = pid_to_state(pid)
ma = check_mem()
vv = pid_to_cmdline(pid)
print(vv)
print('RP: {} | RSS: {} ({} %) | State: {} | time: {} | MemAv'
'ail: {}'.format(rpe, rss, round(float(rss) / (
rss0 + 0.0001) * 100, 1), state, round(d, 3), ma))
print('Send SIGKILL')
os.kill(int(pid), send_signal) os.kill(int(pid), send_signal)
t0 = time() t0 = time()
@ -137,6 +157,9 @@ while True:
state = pid_to_state(pid) state = pid_to_state(pid)
ma = check_mem() ma = check_mem()
vv = pid_to_cmdline(pid)
print(vv)
print('RP: {} | RSS: {} ({} %) | State: {} | time: {} | MemAv' print('RP: {} | RSS: {} ({} %) | State: {} | time: {} | MemAv'
'ail: {}'.format(rpe, rss, round(float(rss) / ( 'ail: {}'.format(rpe, rss, round(float(rss) / (
rss0 + 0.0001) * 100, 1), state, round(d, 3), ma)) rss0 + 0.0001) * 100, 1), state, round(d, 3), ma))