Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(110)

Issue 6266011: chromeos: Simplify user action code. (Closed)

Created:
9 years, 11 months ago by Daniel Erat
Modified:
9 years, 7 months ago
Reviewers:
petkov
CC:
chromium-reviews, davemoore+watch_chromium.org, pam+watch_chromium.org, Luigi Semenzato
Visibility:
Public.

Description

chromeos: Simplify user action code. This makes us (almost) just forward through user actions that we receive from other programs rather than having them listed in Chrome's source. Note that new actions that aren't present in Chrome still need to be added to chrome/tools/extract_actions.py, which needs to be rerun to generate new hashes. I say "almost" above because metrics still need to be added to external_metrics.cc due to http://crosbug.com/11095. Once it's fixed, that requirement can be easily removed. I also cleaned up some earlier additions that I made to extract_actions.py and re-ran it to pick up missing actions. BUG=chromium-os:10403 TEST=built it. checked that i see no errors in chrome's log when using the window manager to report a valid user action, but that i still see an error when running "metrics_client -u BogusMetric" Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=72173

Patch Set 1 #

Patch Set 2 : update extract_actions.py #

Total comments: 2

Patch Set 3 : only report known user actions #

Patch Set 4 : only insert user actions when metrics collection is started #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+44 lines, -55 lines) Patch
M chrome/browser/chromeos/external_metrics.h View 1 2 3 chunks +4 lines, -8 lines 0 comments Download
M chrome/browser/chromeos/external_metrics.cc View 1 2 3 2 chunks +18 lines, -37 lines 1 comment Download
M chrome/tools/chromeactions.txt View 1 1 chunk +5 lines, -0 lines 0 comments Download
M chrome/tools/extract_actions.py View 1 3 chunks +17 lines, -10 lines 0 comments Download

Messages

Total messages: 13 (0 generated)
Daniel Erat
Is there some way for me to test this? http://codereview.chromium.org/6266011/diff/2001/chrome/browser/chromeos/external_metrics.cc File chrome/browser/chromeos/external_metrics.cc (left): http://codereview.chromium.org/6266011/diff/2001/chrome/browser/chromeos/external_metrics.cc#oldcode62 chrome/browser/chromeos/external_metrics.cc:62: ...
9 years, 11 months ago (2011-01-20 00:44:23 UTC) #1
petkov
LGTM I assume there're no relevant tests in external_metrics_unittest.cc? In terms of testing, you could ...
9 years, 11 months ago (2011-01-20 01:00:53 UTC) #2
Daniel Erat
On Wed, Jan 19, 2011 at 5:00 PM, <petkov@chromium.org> wrote: > LGTM > > I ...
9 years, 11 months ago (2011-01-20 01:13:53 UTC) #3
Daniel Erat
On Wed, Jan 19, 2011 at 5:13 PM, Daniel Erat <derat@chromium.org> wrote: > On Wed, ...
9 years, 11 months ago (2011-01-20 01:41:03 UTC) #4
petkov
The chrome log. Sent from my mobile phone. On Jan 19, 2011 5:41 PM, "Daniel ...
9 years, 11 months ago (2011-01-20 01:45:44 UTC) #5
Daniel Erat
Okay, thanks (came to the same conclusion from the code but think I didn't get ...
9 years, 11 months ago (2011-01-20 01:48:02 UTC) #6
Daniel Erat
Now that I'm looking at the logs some more, I see entries like this (pre-dating ...
9 years, 11 months ago (2011-01-20 02:16:15 UTC) #7
petkov
This looks bad. A couple of issues: - Yes, there might be a concern about ...
9 years, 11 months ago (2011-01-20 05:24:27 UTC) #8
Daniel Erat
I filed http://crosbug.com/11125 to track this. I can hold off on these changes and just ...
9 years, 11 months ago (2011-01-20 22:24:56 UTC) #9
petkov
On 2011/01/20 22:24:56, Daniel Erat wrote: > I filed http://crosbug.com/11125 to track this. I can ...
9 years, 11 months ago (2011-01-20 22:33:03 UTC) #10
Daniel Erat
Please take another look. On 2011/01/20 22:33:03, petkov wrote: > On 2011/01/20 22:24:56, Daniel Erat ...
9 years, 11 months ago (2011-01-21 02:52:54 UTC) #11
petkov
LGTM w/ a comment/suggestion. http://codereview.chromium.org/6266011/diff/15001/chrome/browser/chromeos/external_metrics.cc File chrome/browser/chromeos/external_metrics.cc (right): http://codereview.chromium.org/6266011/diff/15001/chrome/browser/chromeos/external_metrics.cc#newcode37 chrome/browser/chromeos/external_metrics.cc:37: // TODO(derat): We shouldn't need ...
9 years, 11 months ago (2011-01-21 18:03:42 UTC) #12
Daniel Erat
9 years, 11 months ago (2011-01-21 18:26:09 UTC) #13
On Fri, Jan 21, 2011 at 10:03 AM,  <petkov@chromium.org> wrote:
> LGTM w/ a comment/suggestion.
>
>
http://codereview.chromium.org/6266011/diff/15001/chrome/browser/chromeos/ext...
> File chrome/browser/chromeos/external_metrics.cc (right):
>
>
http://codereview.chromium.org/6266011/diff/15001/chrome/browser/chromeos/ext...
> chrome/browser/chromeos/external_metrics.cc:37: // TODO(derat): We
> shouldn't need to verify actions before reporting them;
> Or we can modify the regular expression in
> extract_actions.py:GrepForActions to recognize the pattern below too.
> This way we guarantee that we never send unknown actions to the server
> and at the same time keep only one place under Chrome that needs to be
> updated whenever a new action needs to be registered.
>
> Maybe add this as an alternative to the TODO.

I'd still like to see us get to a point where only the hash file needs
to be updated.  Even if I changed extract_actions.py as you suggest,
it would still be possible for people to add new actions to
external_metrics.cc but forget to run the script (this happens
frequently with other metrics), so I don't think that unknown actions
can be prevented here.  Not needing to modify Chrome C++ code and send
changes to trybots when adding new external actions seems like it'd be
a pretty big improvement.

> http://codereview.chromium.org/6266011/
>

Powered by Google App Engine
This is Rietveld 408576698