When we change the version number in metrics_utils:
If the user is not a Googler, or has opted out explicitly, nothing happens
and we still don't collect metrics.
If we're collecting metrics from the user, we stop collecting metrics
and display a notice telling them what has changed.
That notice will be displayed ten times, after which we will
resume collecting metrics. A notice telling them we're collecting metrics
will still be displayed.
Bug: None
Change-Id: If1cc12b2fc06f0d6237714c4f182367b1afdf9fb
Reviewed-on: https://chromium-review.googlesource.com/c/1285395
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>
If we don't have permission to create the metrics.cfg file, print a
notice and disable metrics collection.
Bug: 870231
Change-Id: I784e988ed021daef0fb07c08f1da44718581b1b9
Reviewed-on: https://chromium-review.googlesource.com/1166322
Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
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>
We were printing the notice when the decorator was called, so that if
several functions are decorated, the countdown will increase more than once
during each execution.
This change fixes that.
Bug: 832386
Change-Id: I5d6dd2d793137e1e2c83b6cc765b6245080b9d91
Reviewed-on: https://chromium-review.googlesource.com/1141073
Reviewed-by: Aaron Gable <agable@chromium.org>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>