bug 1237610 - use a mach setting to control telemetry submission. r=gps

Differential Revision: https://phabricator.services.mozilla.com/D4597

--HG--
extra : rebase_source : 4ff227ab9792f84c0a839c43f6ef91f5786cef69
This commit is contained in:
Ted Mielczarek 2018-08-07 12:26:31 -04:00
parent 3028fb8bdb
commit 4da2469474
2 changed files with 11 additions and 2 deletions

View File

@ -190,7 +190,7 @@ def bootstrap(topsrcdir, mozilla_dir=None):
def telemetry_handler(context, data):
# We have not opted-in to telemetry
if 'BUILD_SYSTEM_TELEMETRY' not in os.environ:
if not context.settings.build.telemetry:
return
telemetry_dir = os.path.join(get_state_dir()[0], 'telemetry')
@ -239,7 +239,7 @@ def bootstrap(topsrcdir, mozilla_dir=None):
return
# We have not opted-in to telemetry
if 'BUILD_SYSTEM_TELEMETRY' not in os.environ:
if not context.settings.build.telemetry:
return
# Every n-th operation

View File

@ -2842,3 +2842,12 @@ class Analyze(MachCommandBase):
res = 'Please specify the location of cost_dict.gz with --path.'
print ('Could not find cost_dict.gz at %s' % path, res, sep='\n')
return 1
@SettingsProvider
class TelemetrySettings():
config_settings = [
('build.telemetry', 'boolean', """
Enable submission of build system telemetry.
""".strip(), False),
]