| Index: appengine/findit/crash/crash_data.py
|
| diff --git a/appengine/findit/crash/crash_data.py b/appengine/findit/crash/crash_data.py
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..3c8a07154b752c0f1cfa380b885ab2a31a8c03c1
|
| --- /dev/null
|
| +++ b/appengine/findit/crash/crash_data.py
|
| @@ -0,0 +1,93 @@
|
| +# Copyright 2017 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.
|
| +
|
| +import logging
|
| +from collections import namedtuple
|
| +
|
| +from crash.chromecrash_parser import ChromeCrashParser
|
| +from crash import detect_regression_range
|
| +from crash.stacktrace import Stacktrace
|
| +
|
| +
|
| +class CrashData(object):
|
| + """An abstract class representing crash data sent by clients.
|
| +
|
| + This class is constructed from the raw data that clients sent to Predator, and
|
| + do all necessary analysis to get all information that Predator library needs,
|
| + which means all information for us to create ``CrashReport`` for Predator to
|
| + analyze.
|
| +
|
| + Properties:
|
| + identifiers (dict): The key value pairs to uniquely identify a
|
| + ``CrashData``.
|
| + crashed_version (str): The version of project in which the crash occurred.
|
| + signature (str): The signature of the crash.
|
| + platform (str): The platform name; e.g., 'win', 'mac', 'linux', 'android',
|
| + 'ios', etc.
|
| + stacktrace (Stacktrace): Needs to be implemented.
|
| + regression_range (pair or None): Needs to be implemented.
|
| + dependencies (dict): Needs to be implemented.
|
| + dependency_rolls (dict) Needs to be implemented.
|
| +
|
| + """
|
| + def __init__(self, crash_data):
|
| + """
|
| + Args:
|
| + crash_data (dict): Dicts sent through Pub/Sub by clients. Example:
|
| + {
|
| + 'stack_trace': 'CRASHED [0x43507378...',
|
| + # The Chrome version that produced the stack trace above.
|
| + 'chrome_version': '52.0.2743.41',
|
| + # Client could provide customized data.
|
| + 'customized_data': { # client-specific data
|
| + ...
|
| + },
|
| + 'platform': 'mac', # On which platform the crash occurs.
|
| + 'client_id': 'fracas', # Identify which client this request is from.
|
| + 'signature': '[ThreadWatcher UI hang] base::RunLoopBase::Run',
|
| + 'crash_identifiers': { # A list of key-value to identify a crash.
|
| + ...
|
| + }
|
| + }
|
| + """
|
| + self._identifiers = crash_data['crash_identifiers']
|
| + self._crashed_version = crash_data['chrome_version']
|
| + self._signature = crash_data['signature']
|
| + self._platform = crash_data['platform']
|
| +
|
| + @property
|
| + def identifiers(self):
|
| + return self._identifiers
|
| +
|
| + @property
|
| + def crashed_version(self):
|
| + return self._crashed_version
|
| +
|
| + @property
|
| + def signature(self):
|
| + return self._signature
|
| +
|
| + @property
|
| + def platform(self):
|
| + return self._platform
|
| +
|
| + @platform.setter
|
| + def platform(self, platform):
|
| + self._platform = platform
|
| +
|
| + @property
|
| + def stacktrace(self):
|
| + raise NotImplementedError()
|
| +
|
| + @property
|
| + def regression_range(self):
|
| + raise NotImplementedError()
|
| +
|
| + @property
|
| + def dependencies(self):
|
| + raise NotImplementedError()
|
| +
|
| + @property
|
| + def dependency_rolls(self):
|
| + raise NotImplementedError()
|
|
|