Add total time to test_differ in etc/ci/performance.

This commit is contained in:
Alan Jeffrey 2017-11-13 18:23:56 -06:00
parent 40adc3fd88
commit 201f931fa1

View file

@ -38,6 +38,18 @@ GREEN = '\033[92m'
WARNING = '\033[93m'
END = '\033[0m'
total1 = 0
total2 = 0
def print_line(value1, value2, key):
diff = value2 - value1
change = diff / value1
color = BLUE if value1 <= value2 else GREEN
print("{}{:6} {:6} {:+6} {:+8.2%} {}.{}".format(color, value1, value2, diff, change, key, END))
for key in keys:
value1 = data1.get(key)
value2 = data2.get(key)
@ -46,7 +58,10 @@ for key in keys:
elif value2 and not(value1):
print ("{}Test {}: missing from {}.{}".format(WARNING, key, args.file1, END))
elif value1 and value2:
diff = value2 - value1
change = diff / value1
color = BLUE if value1 <= value2 else GREEN
print("{}{:6} {:6} {:+6} {:+8.2%} {}.{}".format(color, value1, value2, diff, change, key, END))
total1 += value1
total2 += value2
print_line(value1, value2, key)
print("")
print_line(total1, total2, "TOTAL")