Commit Graph

16 Commits (04600b4f26bdd5534788d437d0f82a5a47d97deb)

Author SHA1 Message Date
Edward Lemur 36974ad871 metrics_utils: Fallback to HEAD if upstream is None.
Bug: 934494
Change-Id: I31035d78888747386a37d4a8b05c148aaed37529
Reviewed-on: https://chromium-review.googlesource.com/c/1481937
Reviewed-by: Kenneth Russell <kbr@chromium.org>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
6 years ago
Samuel Huang 98a7e80352 [Metrics] Fix box drawing on Windows, and refactor code.
The Unicode box drawing turn out malformed on Windows (even with
fix_encoding.py). This CL refactors the box drawing code, and makes
Windows box drawing use regular ASCII characters. Details:
* Add print_red_boxed_text() to programatically print box aroun given
  list og strings.
  * Unicode box drawing characters are escaped, removing the use of
    non-ASCII characters in source code.
* Convert message source to generators for greater flexibilty, and
  remove the need for manual horizontal padding.
* Add proper use colorama with Style.BRIGNT and Style.RESET_ALL.
* For Windows, revert to ASCII characters for box drawing.

Change-Id: I71a728db480709b4376d538aaecd701f9197e7ac
Reviewed-on: https://chromium-review.googlesource.com/c/1461249
Commit-Queue: Samuel Huang <huangs@chromium.org>
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
6 years ago
Jared Saul 2d4a955e90 Fix broken metrics collection dialog spacing
The change around line 29-30 in
https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1368409/2/metrics_utils.py
inadvertently removed an extra space.  As a result, the metrics
collection dialog looks like this:
https://screenshot.googleplex.com/3aGtquydCXM.png

Change-Id: I7c9c08949b0df248e6de4f59ec9cfd573ff40901
Reviewed-on: https://chromium-review.googlesource.com/c/1403577
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Commit-Queue: Jared Saul <jsaul@google.com>
6 years ago
Elliott Friedman f6a8ae76df [metrics] Use unicode box-drawing chars and goo.gl link instead
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃      METRICS COLLECTION IS TAKING PLACE           ┃
┃                                                   ┃
┃ To suppress this message opt in or out using:     ┃
┃ $ gclient metrics [--opt-in] [--opt-out]          ┃
┃ For more information please see metrics.README.md ┃
┃ in your depot_tools checkout or visit             ┃
┃ https://goo.gl/yNpRDV.                            ┃
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛

R=ehmaldonado, mmoss, tandrii

Change-Id: Iab3a5a18aa57e603c8f253f3fcbbf7f96727e003
Reviewed-on: https://chromium-review.googlesource.com/c/1368409
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Commit-Queue: Elliott Friedman <friedman@chromium.org>
6 years ago
Edward Lemur 687ca907fd git-cl: Set Code-Review label as a git push argument.
Bug: 877717
Change-Id: I6541a971068aae662b086eba84448bd0769f1a09
Reviewed-on: https://chromium-review.googlesource.com/c/1362405
Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
6 years ago
Peter Boström e28390cc43 Add the opt-in/out commands to metrics notice
Mentioning these commands make it easier for folks to get rid of the
large notice.

Bug: None
Change-Id: I85dd0e1ec0d33999af46f9e20b95bea05bd40a1e
Reviewed-on: https://chromium-review.googlesource.com/c/1330181
Auto-Submit: Peter Boström <pbos@chromium.org>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
7 years ago
Edward Lemur 01f4a4ff1c git-cl: Add tests for metrics collection.
Bug: 897394
Change-Id: I07959e870fef4e6a6b8e6e7c974397d3306460c1
Reviewed-on: https://chromium-review.googlesource.com/c/1315839
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>
7 years ago
Edward Lemur fec80c4135 git-cl: Report git push information to metrics collection.
Bug: 897394
Change-Id: I52a31bb4840b5de89b96545a3e7544c6708f148f
Reviewed-on: https://chromium-review.googlesource.com/c/1312240
Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
7 years ago
Edward Lemur 861640f6c8 metrics: Collect git version.
Bug: None
Change-Id: I73545ad59134c6e5dbeb47fb2e8168a5afc0e497
Reviewed-on: https://chromium-review.googlesource.com/c/1296861
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>
7 years ago
Edward Lemur 5a9ff43554 git-cl: Report Gerrit RPC requests information.
Bug: 897394
Change-Id: I055e844299e262be81d5ac52ef24571b8fdfd47c
Reviewed-on: https://chromium-review.googlesource.com/c/1292245
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
Reviewed-by: Andy Perelson <ajp@chromium.org>
Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>
7 years ago
Edward Lemur 03d6d11896 metrics: Add function to extract metrics from HTTP requests
Bug: 897394
Change-Id: I92d2514e4347f02dbcf2884bef3a073095ee03a3
Reviewed-on: https://chromium-review.googlesource.com/c/1292242
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>
7 years ago
Edward Lemur 488362624b metrics: Add a mechanism to notify users when we want to collect additional metrics.
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>
7 years ago
Edward Lemur c87d45b102 metrics_utils: Print notice to stderr.
Print notice to stderr to avoid interfering with scripts that parse stdout.

Bug: 832386
Change-Id: Ifbcc52809213311489f5c8434b3c16ea53373e57
Reviewed-on: https://chromium-review.googlesource.com/1145697
Reviewed-by: Michael Moss <mmoss@chromium.org>
Reviewed-by: Aaron Gable <agable@chromium.org>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
7 years ago
Edward Lemur 5ba1e9caee git cl: Start reporting metrics.
Bug: 832386
Change-Id: Iccb71c020aea31db33fc16050cb1100ccf5a7fbb
Reviewed-on: https://chromium-review.googlesource.com/1145902
Reviewed-by: Aaron Gable <agable@chromium.org>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
7 years ago
Edward Lemur 40764b07d0 gclient: Report project url if it's a known project.
Bug: 832386
Change-Id: I98aba686f8d575def9a9050c77c057b1749e3235
Reviewed-on: https://chromium-review.googlesource.com/1141164
Reviewed-by: Aaron Gable <agable@chromium.org>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
7 years ago
Edward Lemur 32e3d1e37c Add a library for monitoring.
Change-Id: I64c3d143186be938042c12e2455bdb034d3bcba8
Reviewed-on: https://chromium-review.googlesource.com/1079639
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
Reviewed-by: Aaron Gable <agable@chromium.org>
7 years ago