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

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

Issue 2243693002: [Findit] Filter empty class. (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: Created 4 years, 4 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 from collections import namedtuple 5 from collections import namedtuple
6 from collections import OrderedDict 6 from collections import OrderedDict
7 7
8 from common import constants 8 from common import constants
9 from crash.type_enums import CallStackLanguageType 9 from crash.type_enums import CallStackLanguageType
10 from model.crash.crash_config import CrashConfig 10 from model.crash.crash_config import CrashConfig
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 if class_name not in infos: 84 if class_name not in infos:
85 infos[class_name] = ClassOccurrenceInfo(class_name, [index]) 85 infos[class_name] = ClassOccurrenceInfo(class_name, [index])
86 else: 86 else:
87 infos[class_name].occurrences.append(index) 87 infos[class_name].occurrences.append(index)
88 88
89 return infos.values() 89 return infos.values()
90 90
91 class_infos = _GetClassOccurrenceInfos() 91 class_infos = _GetClassOccurrenceInfos()
92 class_infos = sorted(class_infos, key=rank_function) 92 class_infos = sorted(class_infos, key=rank_function)
93 93
94 classes = [info.name for info in class_infos] 94 # Filter all empty class.
95 classes = [info.name for info in class_infos if info.name]
95 96
96 return classes[:max_classes] 97 return classes[:max_classes]
97 98
98 def Classify(self, results, crash_stack): # pragma: no cover. 99 def Classify(self, results, crash_stack): # pragma: no cover.
99 raise NotImplementedError() 100 raise NotImplementedError()
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698