Chromium Code Reviews| Index: appengine/findit/crash/findit_for_chromecrash.py |
| diff --git a/appengine/findit/crash/findit_for_chromecrash.py b/appengine/findit/crash/findit_for_chromecrash.py |
| index dcb2d3c57f66a6587dfd3fdb607d2be89dc16b52..9badf8fc56a4060e89685c625c44cbdc74b50685 100644 |
| --- a/appengine/findit/crash/findit_for_chromecrash.py |
| +++ b/appengine/findit/crash/findit_for_chromecrash.py |
| @@ -8,11 +8,16 @@ from google.appengine.ext import ndb |
| from common import appengine_util |
| from crash import detect_regression_range |
| -from crash.changelist_classifier import ChangelistClassifier |
| from crash.chromecrash_parser import ChromeCrashParser |
| from crash.component import Component |
| from crash.component_classifier import ComponentClassifier |
| from crash.findit import Findit |
| +from crash.loglinear.changelist_classifier import LogLinearChangelistClassifier |
| +from crash.loglinear.changelist_features.touch_crashed_file_meta import ( |
| + TouchCrashedFileMetaFeature) |
| +from crash.loglinear.feature import WrapperMetaFeature |
| +from crash.loglinear.weight import MetaWeight |
| +from crash.loglinear.weight import Weight |
| from crash.predator import Predator |
| from crash.project import Project |
| from crash.project_classifier import ProjectClassifier |
| @@ -34,6 +39,7 @@ _FRACAS_FEEDBACK_URL_TEMPLATE = 'https://%s/crash/fracas-result-feedback?key=%s' |
| # from historical_metadata (when historical_metadata is provided and |
| # regression_range is not). |
| + |
| class FinditForChromeCrash(Findit): |
| """Find culprits for crash reports from the Chrome Crash server.""" |
| @@ -52,29 +58,41 @@ class FinditForChromeCrash(Findit): |
| # entirely, by passing the relevant data as arguments to this constructor. |
| def __init__(self, get_repository): |
| super(FinditForChromeCrash, self).__init__(get_repository) |
| - project_classifier_config = CrashConfig.Get().project_classifier |
| - component_classifier_config = CrashConfig.Get().component_classifier |
| - self._stacktrace_parser = ChromeCrashParser() |
| + meta_weight = MetaWeight({ |
|
wrengr
2017/01/31 19:42:11
This is fine for now, but eventually we'll want to
Sharu Jiang
2017/02/01 19:32:40
Acknowledged. Added a todo.
|
| + 'TouchCrashedFileMeta': MetaWeight({ |
| + 'MinDistance': Weight(1.), |
| + 'TopFrameIndex': Weight(1.), |
| + 'TouchCrashedFile': Weight(1.), |
| + }) |
| + }) |
| + meta_feature = WrapperMetaFeature( |
| + [TouchCrashedFileMetaFeature(get_repository)]) |
| + project_classifier_config = CrashConfig.Get().project_classifier |
| projects = [Project(name, path_regexs, function_regexs, host_directories) |
| for name, path_regexs, function_regexs, host_directories |
| in project_classifier_config['project_path_function_hosts']] |
| + component_classifier_config = CrashConfig.Get().component_classifier |
| components = [Component(component_name, path_regex, function_regex) |
| for path_regex, function_regex, component_name |
| - in component_classifier_config['path_function_component']], |
| - # The top_n is the number of components we should return as |
| - # components suggestion results. |
| + in component_classifier_config['path_function_component']] |
| + # The top_n is the number of frames we want to check to get component or |
| + # project classifications. |
| # TODO(http://crbug.com/679964) Deprecate the scorer-based changelist |
|
wrengr
2017/01/31 19:42:11
This todo is redundant now
Sharu Jiang
2017/02/01 19:32:39
Done.
|
| # classifier and use loglinear model instead. |
| self._predator = Predator( |
| - cl_classifier = ChangelistClassifier(get_repository), |
| + cl_classifier = LogLinearChangelistClassifier(get_repository, |
| + meta_feature, |
| + meta_weight), |
| component_classifier = ComponentClassifier( |
| components, component_classifier_config['top_n']), |
| project_classifier = ProjectClassifier( |
| projects, project_classifier_config['top_n'], |
| project_classifier_config['non_chromium_project_rank_priority'])) |
| + self._stacktrace_parser = ChromeCrashParser() |
| + |
| def _InitializeAnalysis(self, model, crash_data): |
| super(FinditForChromeCrash, self)._InitializeAnalysis(model, crash_data) |
| # TODO(wrengr): see Note#1 |