[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:
Allen Li
2024-08-19 19:53:47 +00:00
committed by LUCI CQ
parent a3e6229714
commit 04a2e71a92
4 changed files with 26 additions and 3 deletions

View File

@@ -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])