Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(251)

Side by Side Diff: appengine/findit/crash/changelist_classifier.py

Issue 2538373003: [Culprit-Finder] Merge lib/ to libs/. (Closed)
Patch Set: . Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 # Copyright 2016 The Chromium Authors. All rights reserved. 1 # Copyright 2016 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 import logging 5 import logging
6 from collections import defaultdict 6 from collections import defaultdict
7 from collections import namedtuple 7 from collections import namedtuple
8 8
9 from common import chrome_dependency_fetcher 9 from common import chrome_dependency_fetcher
10 from crash import crash_util 10 from crash import crash_util
11 from crash.results import MatchResults 11 from crash.results import MatchResults
12 from crash.scorers.aggregated_scorer import AggregatedScorer 12 from crash.scorers.aggregated_scorer import AggregatedScorer
13 from crash.scorers.min_distance import MinDistance 13 from crash.scorers.min_distance import MinDistance
14 from crash.scorers.top_frame_index import TopFrameIndex 14 from crash.scorers.top_frame_index import TopFrameIndex
15 from crash.stacktrace import CallStack 15 from crash.stacktrace import CallStack
16 from crash.stacktrace import Stacktrace 16 from crash.stacktrace import Stacktrace
17 from lib.gitiles.diff import ChangeType 17 from libs.gitiles.diff import ChangeType
18
18 19
19 class ChangelistClassifier(namedtuple('ChangelistClassifier', 20 class ChangelistClassifier(namedtuple('ChangelistClassifier',
20 ['repository', 'top_n_frames', 'top_n_results', 'confidence_threshold'])): 21 ['repository', 'top_n_frames', 'top_n_results', 'confidence_threshold'])):
21 __slots__ = () 22 __slots__ = ()
22 23
23 def __new__(cls, repository, 24 def __new__(cls, repository,
24 top_n_frames, top_n_results=3, confidence_threshold=0.999): 25 top_n_frames, top_n_results=3, confidence_threshold=0.999):
25 """Args: 26 """Args:
26 repository (Repository): the Git repository for getting CLs to classify. 27 repository (Repository): the Git repository for getting CLs to classify.
27 top_n_frames (int): how many frames of each callstack to look at. 28 top_n_frames (int): how many frames of each callstack to look at.
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after
302 repository.repo_url = stack_deps[dep].repo_url 303 repository.repo_url = stack_deps[dep].repo_url
303 blame = repository.GetBlame(touched_file_path, 304 blame = repository.GetBlame(touched_file_path,
304 stack_deps[dep].revision) 305 stack_deps[dep].revision)
305 306
306 # Generate/update each result(changelog) in changelogs, blame is used 307 # Generate/update each result(changelog) in changelogs, blame is used
307 # to calculate distance between touched lines and crashed lines in file. 308 # to calculate distance between touched lines and crashed lines in file.
308 match_results.GenerateMatchResults( 309 match_results.GenerateMatchResults(
309 touched_file_path, dep, stack_infos, changelogs, blame) 310 touched_file_path, dep, stack_infos, changelogs, blame)
310 311
311 return match_results.values() 312 return match_results.values()
OLDNEW
« no previous file with comments | « appengine/findit/common/test/chrome_dependency_fetcher_test.py ('k') | appengine/findit/crash/component_classifier.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698