From 306b03b1912affcae0dbecbe5aa36b414fb4ae2a Mon Sep 17 00:00:00 2001 From: Josip Sokcevic Date: Wed, 23 Feb 2022 03:25:23 +0000 Subject: [PATCH] Collect metrics on git_map_branches R=calamity@chromium.org Change-Id: Iee4634462c598685032c8a5ffcfd3b9766726958 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3482664 Auto-Submit: Josip Sokcevic Reviewed-by: Christopher Lam Commit-Queue: Christopher Lam --- git_map_branches.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/git_map_branches.py b/git_map_branches.py index 8c5ea714e..ca5f95134 100755 --- a/git_map_branches.py +++ b/git_map_branches.py @@ -28,6 +28,7 @@ from __future__ import print_function import argparse import collections +import metrics import os import subprocess2 import sys @@ -311,6 +312,7 @@ def print_desc(): print(outline) print('') +@metrics.collector.collect_metrics('git map-branches') def main(argv): setup_color.init() if get_git_version() < MIN_UPSTREAM_TRACK_GIT_VERSION: @@ -349,7 +351,8 @@ def main(argv): if __name__ == '__main__': try: - sys.exit(main(sys.argv[1:])) + with metrics.collector.print_notice_and_exit(): + sys.exit(main(sys.argv[1:])) except KeyboardInterrupt: sys.stderr.write('interrupted\n') sys.exit(1)