Backed out changeset 69ddf4e384ab (bug 1335343) for lint failures a=backout

MozReview-Commit-ID: Gg0mdbON3gz
This commit is contained in:
Wes Kocher 2017-05-10 10:29:46 -07:00
Родитель 9a4c947617
Коммит a763252e27
3 изменённых файлов: 1 добавлений и 1564 удалений

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -106,7 +106,6 @@ The following is a sample histogram declaration from ``Histograms.json`` for a h
.. code-block:: json .. code-block:: json
"MEMORY_RESIDENT": { "MEMORY_RESIDENT": {
"record_in_processes": ["main", "content"],
"alert_emails": ["team@mozilla.xyz"], "alert_emails": ["team@mozilla.xyz"],
"expires_in_version": "never", "expires_in_version": "never",
"kind": "exponential", "kind": "exponential",
@ -121,16 +120,6 @@ Histograms which track timings in milliseconds or microseconds should suffix the
The possible fields in a histogram declaration are listed below. The possible fields in a histogram declaration are listed below.
``record_in_processes``
-----------------------
Required. This field is a list of processes this histogram can be recorded in. Currently-supported values are:
- ``main``
- ``content``
- ``gpu``
- ``all_child`` (record in all child processes)
- ``all`` (record in all processes)
``alert_emails`` ``alert_emails``
---------------- ----------------
Required. This field is a list of e-mail addresses that should be notified when the distribution of the histogram changes significantly from one build-id to the other. This can be useful to detect regressions. Note that all alerts will be sent automatically to mozilla.dev.telemetry-alerts. Required. This field is a list of e-mail addresses that should be notified when the distribution of the histogram changes significantly from one build-id to the other. This can be useful to detect regressions. Note that all alerts will be sent automatically to mozilla.dev.telemetry-alerts.

Просмотреть файл

@ -9,7 +9,6 @@ import math
import os import os
import re import re
import sys import sys
import shared_telemetry_utils as utils
from shared_telemetry_utils import ParserError from shared_telemetry_utils import ParserError
from collections import OrderedDict from collections import OrderedDict
@ -66,7 +65,7 @@ def exponential_buckets(dmin, dmax, n_buckets):
always_allowed_keys = ['kind', 'description', 'cpp_guard', 'expires_in_version', always_allowed_keys = ['kind', 'description', 'cpp_guard', 'expires_in_version',
'alert_emails', 'keyed', 'releaseChannelCollection', 'alert_emails', 'keyed', 'releaseChannelCollection',
'bug_numbers', 'record_in_processes'] 'bug_numbers']
whitelists = None whitelists = None
try: try:
@ -103,8 +102,6 @@ The key 'cpp_guard' is optional; if present, it denotes a preprocessor
symbol that should guard C/C++ definitions associated with the histogram.""" symbol that should guard C/C++ definitions associated with the histogram."""
self._strict_type_checks = strict_type_checks self._strict_type_checks = strict_type_checks
self._is_use_counter = name.startswith("USE_COUNTER2_") self._is_use_counter = name.startswith("USE_COUNTER2_")
if self._is_use_counter:
definition.setdefault('record_in_processes', ['main', 'content'])
self.verify_attributes(name, definition) self.verify_attributes(name, definition)
self._name = name self._name = name
self._description = definition['description'] self._description = definition['description']
@ -170,14 +167,6 @@ associated with the histogram. Returns None if no guarding is necessary."""
"""Returns a list of labels for a categorical histogram, [] for others.""" """Returns a list of labels for a categorical histogram, [] for others."""
return self._labels return self._labels
def record_in_processes(self):
"""Returns a list of processes this histogram is permitted to record in."""
return self.definition['record_in_processes']
def record_in_processes_enum(self):
"""Get the non-empty list of flags representing the processes to record data in"""
return [utils.process_name_to_enum(p) for p in self.record_in_processes]
def ranges(self): def ranges(self):
"""Return an array of lower bounds for each bucket in the histogram.""" """Return an array of lower bounds for each bucket in the histogram."""
bucket_fns = { bucket_fns = {
@ -243,7 +232,6 @@ associated with the histogram. Returns None if no guarding is necessary."""
self.check_whitelistable_fields(name, definition) self.check_whitelistable_fields(name, definition)
self.check_expiration(name, definition) self.check_expiration(name, definition)
self.check_label_values(name, definition) self.check_label_values(name, definition)
self.check_record_in_processes(name, definition)
def check_name(self, name): def check_name(self, name):
if '#' in name: if '#' in name:
@ -304,18 +292,6 @@ associated with the histogram. Returns None if no guarding is necessary."""
raise ParserError('Label values for %s are not matching pattern "%s": %s' % raise ParserError('Label values for %s are not matching pattern "%s": %s' %
(name, pattern, ', '.join(invalid))) (name, pattern, ', '.join(invalid)))
def check_record_in_processes(self, name, definition):
field = 'record_in_processes'
rip = definition.get(field);
if not rip:
raise ParserError('Histogram "%s" must have a "%s" field.' % (name, field))
for process in rip:
if not utils.is_valid_process_name(process):
raise ParserError('Histogram "%s" has unknown process "%s" in %s.' %
(name, process, field))
def check_whitelisted_kind(self, name, definition): def check_whitelisted_kind(self, name, definition):
# We don't need to run any of these checks on the server. # We don't need to run any of these checks on the server.
if not self._strict_type_checks or whitelists is None: if not self._strict_type_checks or whitelists is None:
@ -382,7 +358,6 @@ associated with the histogram. Returns None if no guarding is necessary."""
"bug_numbers": int, "bug_numbers": int,
"alert_emails": basestring, "alert_emails": basestring,
"labels": basestring, "labels": basestring,
"record_in_processes": basestring,
} }
# For the server-side, where _strict_type_checks==False, we want to # For the server-side, where _strict_type_checks==False, we want to