depot_tools: Make metrics Python 3 compatible.

Bug: 984182
Change-Id: I2b7e4be6131558019d461e09d062b52085f330ba
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1702855
Reviewed-by: Andy Perelson <ajp@chromium.org>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
changes/55/1702855/2
Edward Lemur 6 years ago committed by Commit Bot
parent 966ad1914b
commit 9217ff8b2c

@ -226,7 +226,7 @@ def extract_http_metrics(request_uri, method, status, response_time):
if parsed_url.netloc in KNOWN_HTTP_HOSTS:
http_metrics['host'] = parsed_url.netloc
for name, path_re in KNOWN_HTTP_PATHS.iteritems():
for name, path_re in KNOWN_HTTP_PATHS.items():
if path_re.match(parsed_url.path):
http_metrics['path'] = name
break
@ -287,7 +287,7 @@ def print_notice(countdown):
def print_version_change(config_version):
"""Print a notice to let the user know we are collecting more metrics."""
lines = list(get_notice_version_change_header())
for version in xrange(config_version + 1, CURRENT_VERSION + 1):
for version in range(config_version + 1, CURRENT_VERSION + 1):
lines.append('')
lines += list(get_change_notice(version))
print_boxed_text(sys.stderr.write, 49, lines)

@ -13,7 +13,6 @@ sys.path.insert(0, ROOT_DIR)
import metrics
import metrics_utils
import cStringIO
from third_party import mock

Loading…
Cancel
Save