mirror of
https://chromium.googlesource.com/chromium/tools/depot_tools.git
synced 2026-01-11 18:51:29 +00:00
metrics: Separate metrics collection and print notice logic.
As it is right now, when a function is collecting metrics it prints the notice and calls sys.exit() to ensure the notice is the last thing that is printed. git-cl split has to call git-cl upload multiple times, but once it has been called once, it exits, so only the first cl is uploaded. This separates metrics collection from notice printing, so that the function that is collecting metrics behaves like a function that isn't. It also makes sure we don't collect metrics for multiple functions at the same time. Bug: 868280 Change-Id: Ic58ebe7d19e09ed85fa8b0af76dcbf608ee4c9bc Reviewed-on: https://chromium-review.googlesource.com/1153503 Reviewed-by: Aaron Gable <agable@chromium.org> Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
This commit is contained in:
@@ -62,8 +62,5 @@ def main(args):
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
try:
|
||||
with metrics.collector.print_notice_and_exit():
|
||||
sys.exit(main(sys.argv[1:]))
|
||||
except KeyboardInterrupt:
|
||||
sys.stderr.write('interrupted\n')
|
||||
sys.exit(1)
|
||||
|
||||
Reference in New Issue
Block a user