Disable printing percent change on run time by default

This commit disables printing the percent change in run time by
default. This was a cool experiment, but isn't really useful in
practice. Especially in the gate, things are so noisy and there
is so much variance looking at the change for a single doesn't
actually mean anything. It makes more sense to make this feature
opt-in because it's not generally useful.

Change-Id: Iecb153452edfe1d7b55757d022ae0331ac563b35
This commit is contained in:
Matthew Treinish 2015-06-23 19:23:13 -04:00
parent de604832c3
commit 7376e96ab3

View File

@ -147,7 +147,7 @@ def find_test_run_time_diff(test_id, run_time):
def show_outcome(stream, test, print_failures=False, failonly=False,
threshold='0'):
enable_diff=False, threshold='0'):
global RESULTS
status = test['status']
# TODO(sdague): ask lifeless why on this?
@ -176,6 +176,7 @@ def show_outcome(stream, test, print_failures=False, failonly=False,
if status == 'success':
out_string = '{%s} %s [%s' % (worker, name, duration)
perc_diff = find_test_run_time_diff(test['id'], duration)
if enable_diff:
if perc_diff and abs(perc_diff) >= abs(float(threshold)):
if perc_diff > 0:
out_string = out_string + ' +%.2f%%' % perc_diff
@ -282,6 +283,9 @@ def parse_args():
default=(
os.environ.get('TRACE_FAILONLY', False)
is not False))
parser.add_argument('--perc-diff', '-d', action='store_true',
dest='enable_diff',
help="Print percent change in run time on each test ")
parser.add_argument('--diff-threshold', '-t', dest='threshold',
help="Threshold to use for displaying percent change "
"from the avg run time. If one is not specified "
@ -299,7 +303,8 @@ def main():
outcomes = testtools.StreamToDict(
functools.partial(show_outcome, sys.stdout,
print_failures=args.print_failures,
failonly=args.failonly))
failonly=args.failonly,
enable_diff=args.enable_diff))
summary = testtools.StreamSummary()
result = testtools.CopyStreamResult([outcomes, summary])
result = testtools.StreamResultRouter(result)