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

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

Issue 2414523002: [Findit] Reorganizing findit_for_*.py (Closed)
Patch Set: trying to fix some tests Created 4 years, 2 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
OLDNEW
(Empty)
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
3 # found in the LICENSE file.
4
5 import logging
6 from collections import namedtuple
7
8 from crash.stacktrace import Stacktrace
9
10 # TODO(katesonia): the CrashAnalysis(ndb.Model) is how we store these
11 # objects in the application. However, note that these aren't actually
12 # "analyses"; they're the *input* to our analysis, whereas Culprit
Sharu Jiang 2016/10/12 17:46:29 The CrashAnalysis contains *input* and *output* of
wrengr 2016/10/12 21:14:51 Acknowledged.
13 # is the output from analysis. So the ndb.Model and assorted other things
14 # should be renamed appropriately. However, in general we don't yet have
15 # a standard for distinguishing the namedtuples used internally by azalea
16 # vs the ndb.Models for storing those namedtuples in the appengine
17 # application; so we'll want to come up with a naming scheme for that.
18 class CrashReport(namedtuple('CrashReport',
19 ['crashed_version', 'signature', 'platform', 'stacktrace',
20 'regression_range'])):
21 """A reported crash we want to analyze.
22
23 Args:
24 crashed_version (str): The version of Chrome in which the crash occurred.
25 signature (str): The signature of the crash on the Chrome crash server.
26 platform (str): The platform name; e.g., 'win', 'mac', 'linux', 'android',
27 'ios', etc.
28 stacktrace (Stacktrace): The stacktrace of the crash. N.B., this is
29 an object generated by parsing the string containing the stack trace;
30 we do not store the string itself.
31 regression_range : a pair of the last-good and first-bad versions.
32 """
33 __slots__ = ()
34
35 def __new__(cls, crashed_version, signature, platform, stacktrace, regression_ range):
36 if not isinstance(stacktrace, Stacktrace):
37 raise TypeError('In the fourth argument to CrashReport constructor, '
38 'expected Stacktrace object, but got %s object instead.' %
39 stacktrace.__class__.__name__)
40
41 return super(cls, CrashReport).__new__(cls,
42 crashed_version, signature, platform, stacktrace, regression_range)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698