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

Unified Diff: appengine/findit/crash/scorers/top_frame_index.py

Issue 2707603002: [Predator] Generate all changelogs in regression ranges instead of only matched changelogs (Closed)
Patch Set: . Created 3 years, 10 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « appengine/findit/crash/scorers/test/top_frame_index_test.py ('k') | appengine/findit/crash/stacktrace.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: appengine/findit/crash/scorers/top_frame_index.py
diff --git a/appengine/findit/crash/scorers/top_frame_index.py b/appengine/findit/crash/scorers/top_frame_index.py
deleted file mode 100644
index e1f2399900425655562ddf9f7635ce7cb4a5172b..0000000000000000000000000000000000000000
--- a/appengine/findit/crash/scorers/top_frame_index.py
+++ /dev/null
@@ -1,49 +0,0 @@
-# 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.
-
-"""TopFrameIndex scorer applies to all Result objects.
-
-It represents a heuristic rule:
- The less the top frame index (this result changed) is, the higher score.
-"""
-
-from crash.scorers.scorer import Scorer
-
-# TODO(katesonia): Move this to the config saved in datastore.
-_MAX_TOP_N_FRAMES = 7
-_INFINITY = 1000
-
-
-class TopFrameIndex(Scorer):
-
- def __init__(self, max_top_n=_MAX_TOP_N_FRAMES):
- self.max_top_n = max_top_n
-
- def GetMetric(self, result):
- if not result.file_to_stack_infos:
- return None
-
- top_frame_index = _INFINITY
- for _, stack_infos in result.file_to_stack_infos.iteritems():
- for frame, _ in stack_infos:
- top_frame_index = min(top_frame_index, frame.index)
-
- return top_frame_index
-
- def Score(self, top_frame_index):
- # TODO(katesonia): experiment the model and parameters later.
- if top_frame_index < self.max_top_n:
- return 1 - top_frame_index / float(self.max_top_n)
-
- return 0
-
- def Reason(self, top_frame_index, score):
- if score == 0:
- return None
-
- return self.name, score, 'Top frame is #%d' % top_frame_index
-
- def ChangedFiles(self, result, score):
- # There is no changed file infos that top frame scorer can provide.
- return None
« no previous file with comments | « appengine/findit/crash/scorers/test/top_frame_index_test.py ('k') | appengine/findit/crash/stacktrace.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698