From 6d0c235dae4b7e664122eba4a02f97d4cf155241 Mon Sep 17 00:00:00 2001 From: Bruce Dawson Date: Sun, 6 Aug 2023 02:38:51 +0000 Subject: [PATCH] Print reproxy start/stop times On NOP or incremental builds the reproxy startup/shutdown times can be a significant portion of the total build time and it is important to acknowledge these times. Bug: b/294443556 Change-Id: Ic63331683632c8f447858b498f53d254b56ffe89 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4753472 Reviewed-by: Philipp Wollermann Commit-Queue: Bruce Dawson --- reclient_helper.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/reclient_helper.py b/reclient_helper.py index 6b4ec29118..c81c28d86b 100644 --- a/reclient_helper.py +++ b/reclient_helper.py @@ -12,6 +12,7 @@ import os import shutil import subprocess import sys +import time import gclient_paths import reclient_metrics @@ -225,7 +226,10 @@ def build_context(argv, tool): # TODO(b/292523514) remove this once a fix is landed in reproxy remove_mdproxy_from_path() + start = time.time() reproxy_ret_code = start_reproxy(reclient_cfg, reclient_bin_dir) + elapsed = time.time() - start + print('%1.3f s to start reproxy' % elapsed) if reproxy_ret_code != 0: yield reproxy_ret_code return @@ -233,4 +237,7 @@ def build_context(argv, tool): yield finally: print("Shutting down reproxy...", file=sys.stderr) + start = time.time() stop_reproxy(reclient_cfg, reclient_bin_dir) + elapsed = time.time() - start + print('%1.3f s to stop reproxy' % elapsed)