Chromium Code Reviews| Index: appengine/findit/crash/azalea.py |
| diff --git a/appengine/findit/crash/azalea.py b/appengine/findit/crash/azalea.py |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..1789eddf965cbc4b78c67598606672cb1457ebee |
| --- /dev/null |
| +++ b/appengine/findit/crash/azalea.py |
| @@ -0,0 +1,31 @@ |
| +# Copyright 2016 The Chromium Authors. All rights reserved. |
| +# Use of this source code is governed by a BSD-style license that can be |
| +# found in the LICENSE file. |
| + |
| +from crash.culprit import Culprit |
| + |
| +class Azalea(object): |
| + """The Main entry point into the Azalea library.""" |
| + |
| + def __init__(self, cl_classifier, component_classifier, project_classifier): |
| + self.cl_classifier = cl_classifier |
| + self.component_classifier = component_classifier |
| + self.project_classifier = project_classifier |
| + |
| + # TODO(wrengr): also detect the regression range, if needed. |
|
Sharu Jiang
2016/10/12 17:46:29
Not needed, the regression range is already detect
|
| + def FindCulprit(self, report): |
| + """Given a CrashReport, return a Culprit.""" |
| + suspected_cls = self.cl_classifier(report) |
| + |
| + suspected_project = self.project_classifier.Classify( |
| + suspected_cls, report.stacktrace.crash_stack) |
| + |
| + suspected_components = self.component_classifier.Classify( |
| + suspected_cls, report.stacktrace.crash_stack) |
| + |
| + return Culprit( |
| + project = suspected_project, |
| + components = suspected_components, |
| + cls = suspected_cls, |
| + regression_range = report.regression_range, |
| + algorithm = 'core_algorithm') |