mirror of
https://chromium.googlesource.com/chromium/tools/depot_tools.git
synced 2026-01-11 10:41:31 +00:00
[metrics] Add new auth metric
Bug: b/358442026 Change-Id: If91494b52fe27177f68e42ec40977fd8ca1fd4cc Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5786166 Commit-Queue: Allen Li <ayatane@chromium.org> Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
This commit is contained in:
14
metrics.py
14
metrics.py
@@ -1,4 +1,3 @@
|
||||
#!/usr/bin/env python3
|
||||
# Copyright (c) 2018 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.
|
||||
@@ -16,6 +15,7 @@ import urllib.request
|
||||
import detect_host_arch
|
||||
import gclient_utils
|
||||
import metrics_utils
|
||||
import newauth
|
||||
import subprocess2
|
||||
import utils
|
||||
|
||||
@@ -251,6 +251,18 @@ class MetricsCollector(object):
|
||||
if bot_metrics:
|
||||
self.add('bot_metrics', bot_metrics)
|
||||
|
||||
# TODO(b/347085702): Remove this variable when dogfood is over.
|
||||
new_auth_enabled = 'DEFAULT'
|
||||
if newauth.Enabled():
|
||||
new_auth_enabled = 'TRUE'
|
||||
elif newauth.ExplicitlyDisabled():
|
||||
new_auth_enabled = 'FALSE'
|
||||
if new_auth_enabled != 'DEFAULT':
|
||||
self.add_repeated('env_vars', {
|
||||
'name': 'DOGFOOD_NEW_AUTH',
|
||||
'value': new_auth_enabled,
|
||||
})
|
||||
|
||||
self._upload_metrics_data()
|
||||
if exception:
|
||||
gclient_utils.reraise(exception[0], exception[1], exception[2])
|
||||
|
||||
Reference in New Issue
Block a user