Improve output

This commit is contained in:
Alexey Avramov 2020-06-12 13:38:21 +09:00
parent d457aaea38
commit f00a394783
2 changed files with 14 additions and 8 deletions

View File

@ -97,7 +97,7 @@ met = args.metrics
if not (met == 'memory' or met == 'io' or met == 'cpu'):
print('Invalid metrics:', met)
print('ERROR: invalid metrics:', met)
exit(1)
@ -130,9 +130,9 @@ path_list = get_psi_mem_files(cgroup2_mountpoint, met)
head_mem_io = '''PSI metrics: {}
cgroup_v2 mountpoint: {}
---------------------------------------------------------
=====================|======================|
some | full |
-------------------- | -------------------- | -----------
-------------------- | -------------------- |
avg10 avg60 avg300 | avg10 avg60 avg300 | cgroup_v2
------ ------ ------ | ------ ------ ------ | -----------'''.format(
met, cgroup2_mountpoint)
@ -140,9 +140,9 @@ cgroup_v2 mountpoint: {}
head_cpu = '''PSI metrics: {}
cgroup_v2 mountpoint: {}
----------------------------------
=====================|
some |
-------------------- | -----------
-------------------- |
avg10 avg60 avg300 | cgroup_v2
------ ------ ------ | -----------'''.format(
met, cgroup2_mountpoint)

View File

@ -286,7 +286,7 @@ def print_head_2():
"""
"""
log('======|=============|=============|')
log(' cpu | io | memory |')
log(' cpu | io | memory |')
log('----- | ----------- | ----------- |')
log(' some | some full | some full | interval')
log('----- | ----- ----- | ----- ----- | --------')
@ -412,9 +412,15 @@ else:
logstring = 'log file is not set, '
if interval < 0.1:
log_head('error: argument -i/--interval: the value must be greater than or'
' equal to 0.1')
exit(1)
log_head('Starting psi2log, target: {}, mode: {}, interval: {} sec, {}suppress'
' output: {}'.format(
target, mode, interval, logstring, suppress_output))
target, mode, round(interval, 3), logstring, suppress_output))
fd = dict()
@ -540,7 +546,7 @@ if mode == '2':
round(avg_ms, 1),
round(avg_mf, 1),
round(dm, 3)
round(dm, 2)
))