Loading ci/complexity_measurements/check_for_changes.py +14 −2 Original line number Diff line number Diff line Loading @@ -33,8 +33,20 @@ def check_linewise_logfile(filepath, cols): # do not report any changes then prev = curr change_ratios = [abs(float(curr[i]) / float(prev[i]) - 1) > THRESH for i in cols] changes_found = any(change_ratios) changes_found = False for c in cols: if curr[c] == prev[c]: abs_perc_change = 0 else: try: abs_perc_change = abs(float(curr[c]) / float(prev[c]) - 1) except ZeroDivisionError: # in some cases, such as missing instrumentation, values can be zero, so catch that here # from the first if we know that curr can not be 0 too -> report change abs_perc_change = THRESH + 1 if abs_perc_change > THRESH: changes_found = True break if changes_found: print("Previous log line:", prev) Loading Loading
ci/complexity_measurements/check_for_changes.py +14 −2 Original line number Diff line number Diff line Loading @@ -33,8 +33,20 @@ def check_linewise_logfile(filepath, cols): # do not report any changes then prev = curr change_ratios = [abs(float(curr[i]) / float(prev[i]) - 1) > THRESH for i in cols] changes_found = any(change_ratios) changes_found = False for c in cols: if curr[c] == prev[c]: abs_perc_change = 0 else: try: abs_perc_change = abs(float(curr[c]) / float(prev[c]) - 1) except ZeroDivisionError: # in some cases, such as missing instrumentation, values can be zero, so catch that here # from the first if we know that curr can not be 0 too -> report change abs_perc_change = THRESH + 1 if abs_perc_change > THRESH: changes_found = True break if changes_found: print("Previous log line:", prev) Loading