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 <philwo@google.com>
Commit-Queue: Bruce Dawson <brucedawson@chromium.org>
changes/72/4753472/2
Bruce Dawson 2 years ago committed by LUCI CQ
parent 138e18725c
commit 6d0c235dae

@ -12,6 +12,7 @@ import os
import shutil import shutil
import subprocess import subprocess
import sys import sys
import time
import gclient_paths import gclient_paths
import reclient_metrics import reclient_metrics
@ -225,7 +226,10 @@ def build_context(argv, tool):
# TODO(b/292523514) remove this once a fix is landed in reproxy # TODO(b/292523514) remove this once a fix is landed in reproxy
remove_mdproxy_from_path() remove_mdproxy_from_path()
start = time.time()
reproxy_ret_code = start_reproxy(reclient_cfg, reclient_bin_dir) 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: if reproxy_ret_code != 0:
yield reproxy_ret_code yield reproxy_ret_code
return return
@ -233,4 +237,7 @@ def build_context(argv, tool):
yield yield
finally: finally:
print("Shutting down reproxy...", file=sys.stderr) print("Shutting down reproxy...", file=sys.stderr)
start = time.time()
stop_reproxy(reclient_cfg, reclient_bin_dir) stop_reproxy(reclient_cfg, reclient_bin_dir)
elapsed = time.time() - start
print('%1.3f s to stop reproxy' % elapsed)

Loading…
Cancel
Save