diff --git a/etc/ci/performance/test_differ.py b/etc/ci/performance/test_differ.py index 1f699633d5a..0bc0df27184 100644 --- a/etc/ci/performance/test_differ.py +++ b/etc/ci/performance/test_differ.py @@ -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")