Skip to content
This repository was archived by the owner on Dec 14, 2021. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions alerts.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,8 @@ def compare(test, buildername, revision, previous_revision):
if revision_perfdata and previous_revision_perfdata:
mean_revision_perfdata = sum(revision_perfdata) / float(len(revision_perfdata))
mean_previous_revision_perfdata = sum(previous_revision_perfdata) / float(len(previous_revision_perfdata))
else:
return None


if test in REVERSE_TESTS:
Expand Down Expand Up @@ -222,11 +224,17 @@ def main():
badRevisions = []
# Reset the loop for upcoming stages
alert['loop'] = 0
results = None
for i in range(1, len(revisionList)):
results = compare(alert['test'], alert['buildername'], revisionList[i], revisionList[i-1])
if results < -2.0:
badRevisions.append(revisionList[i])

if results is None:
LOG.info("We did not find perf data for the revisions for alert %s on buildername %s. "
"Will loop once again." % (alert['test'], alert['buildername']))
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we continue in this loop if we hit this case 4 or 5 times in a row? I think 3 times should be a limit, but that is hard to tell. Will we hit any other timeouts to terminate this cycle?

continue

if len(badRevisions) != 1:
LOG.info("There are too many bad revisions: %s for alert %s on buildername %s, "
"assigning for human inspection." % (badRevisions, alert['test'], alert['buildername']))
Expand Down