From 09f358bae36c316e3c4c39cd344de964bd0fed7c Mon Sep 17 00:00:00 2001 From: Edward Lesmes Date: Tue, 22 Jun 2021 22:31:52 +0000 Subject: [PATCH] metrics: Don't collect metrics on DEPOT_TOOLS_METRICS=0 Before crrev.com/c/2876082, DEPOT_TOOLS_METRICS=0 was the env var used to disable metrics collection. Bug: b/191388102 Change-Id: I0db9d034562f2eb1afb53818b3853cef50c09826 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2980230 Commit-Queue: Edward Lesmes Commit-Queue: Jack Neus Auto-Submit: Edward Lesmes Reviewed-by: Jack Neus --- metrics_utils.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/metrics_utils.py b/metrics_utils.py index 1df2d0537..7097857a7 100644 --- a/metrics_utils.py +++ b/metrics_utils.py @@ -25,7 +25,9 @@ CURRENT_VERSION = 2 APP_URL = 'https://cit-cli-metrics.appspot.com' REPORT_BUILD = os.getenv('DEPOT_TOOLS_REPORT_BUILD') -COLLECT_METRICS = os.getenv('DEPOT_TOOLS_COLLECT_METRICS') != '0' +COLLECT_METRICS = ( + os.getenv('DEPOT_TOOLS_COLLECT_METRICS') != '0' + and os.getenv('DEPOT_TOOLS_METRICS') != '0') SYNC_STATUS_SUCCESS = 'SYNC_STATUS_SUCCESS' SYNC_STATUS_FAILURE = 'SYNC_STATUS_FAILURE'