[~] Refactor
This commit is contained in:
parent
9f44796795
commit
09d7e23792
@ -245,6 +245,12 @@ def eternal_oom(argv):
|
||||
action='store_true',
|
||||
default=None,
|
||||
)
|
||||
parser.add_option(
|
||||
'--cpu',
|
||||
dest='cpu_json',
|
||||
type=str,
|
||||
default=None,
|
||||
)
|
||||
parser.add_option(
|
||||
'--one_shot_app',
|
||||
dest='one_shot_app',
|
||||
@ -277,6 +283,11 @@ def eternal_oom(argv):
|
||||
)
|
||||
options, args = parser.parse_args(argv)
|
||||
|
||||
if not options.cpu_json is None:
|
||||
options.cpu = json.loads(options.cpu_json)
|
||||
else:
|
||||
options.cpu = True
|
||||
|
||||
self_pid = os.getpid()
|
||||
|
||||
if isinstance(options.one_shot_clean, bool) and options.one_shot_clean:
|
||||
@ -753,7 +764,7 @@ def eternal_oom(argv):
|
||||
])
|
||||
t4()
|
||||
|
||||
if oom_cpu_high():
|
||||
if options.cpu and oom_cpu_high():
|
||||
oom_display_rows(t11['by_cpu'])
|
||||
print('\n', end='')
|
||||
pprint.pprint([
|
||||
|
Loading…
Reference in New Issue
Block a user