git cl: Start reporting metrics.

Bug: 832386
Change-Id: Iccb71c020aea31db33fc16050cb1100ccf5a7fbb
Reviewed-on: https://chromium-review.googlesource.com/1145902
Reviewed-by: Aaron Gable <agable@chromium.org>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
This commit is contained in:
Edward Lemur
2018-07-23 18:19:02 +00:00
committed by Commit Bot
parent 9fa97b59b1
commit 5ba1e9caee
5 changed files with 50 additions and 8 deletions

View File

@@ -23,8 +23,6 @@ DEPOT_TOOLS = os.path.dirname(os.path.abspath(__file__))
CONFIG_FILE = os.path.join(DEPOT_TOOLS, 'metrics.cfg')
UPLOAD_SCRIPT = os.path.join(DEPOT_TOOLS, 'upload_metrics.py')
APP_URL = 'https://cit-cli-metrics.appspot.com'
DISABLE_METRICS_COLLECTION = os.environ.get('DEPOT_TOOLS_METRICS') == '0'
DEFAULT_COUNTDOWN = 10
@@ -55,7 +53,7 @@ class _Config(object):
# check if we can reach the page. An external developer would get access
# denied.
try:
req = urllib2.urlopen(APP_URL + '/should-upload')
req = urllib2.urlopen(metrics_utils.APP_URL + '/should-upload')
self._config['is-googler'] = req.getcode() == 200
except (urllib2.URLError, urllib2.HTTPError):
self._config['is-googler'] = False