mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Merge pull request #29217 from clan/highstate_duration
show duration only if state_output_profile is False
This commit is contained in:
commit
f488d25911
1 changed files with 11 additions and 10 deletions
|
@ -371,16 +371,17 @@ def _format_host(host, data):
|
|||
line_max_len - 7)
|
||||
hstrs.append(colorfmt.format(colors['CYAN'], totals, colors))
|
||||
|
||||
sum_duration = sum(rdurations)
|
||||
duration_unit = 'ms'
|
||||
# convert to seconds if duration is 1000ms or more
|
||||
if sum_duration > 999:
|
||||
sum_duration /= 1000
|
||||
duration_unit = 's'
|
||||
total_duration = u'Total run time: {0} {1}'.format(
|
||||
'{0:.3f}'.format(sum_duration).rjust(line_max_len - 5),
|
||||
duration_unit)
|
||||
hstrs.append(colorfmt.format(colors['CYAN'], total_duration, colors))
|
||||
if __opts__.get('state_output_profile', False):
|
||||
sum_duration = sum(rdurations)
|
||||
duration_unit = 'ms'
|
||||
# convert to seconds if duration is 1000ms or more
|
||||
if sum_duration > 999:
|
||||
sum_duration /= 1000
|
||||
duration_unit = 's'
|
||||
total_duration = u'Total run time: {0} {1}'.format(
|
||||
'{0:.3f}'.format(sum_duration).rjust(line_max_len - 5),
|
||||
duration_unit)
|
||||
hstrs.append(colorfmt.format(colors['CYAN'], total_duration, colors))
|
||||
|
||||
if strip_colors:
|
||||
host = salt.output.strip_esc_sequence(host)
|
||||
|
|
Loading…
Add table
Reference in a new issue