Chromium Code Reviews
Help | Chromium Project | Sign in
(103)

Issue 2751403002: Record the fraction of the time without user input - Aura only

Can't Edit
Can't Publish+Mail
Start Review
Created:
1 week, 1 day ago by tdresser
Modified:
4 hours, 27 minutes ago
Reviewers:
sadrul
CC:
chromium-reviews, kalyank, sadrul, asvitkine+watch_chromium.org
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Record the fraction of the time without user input - Aura only. We don't have a good sense of how long Chrome sits idle, without any input. Gather this via UMA. I'll plumb up the FractionOfTimeWithoutUserInputRecorder on other platforms in subsequent patches. BUG=702198

Patch Set 1 #

Patch Set 2 : Rename everything, fix compile, fix arithmetic error. #

Patch Set 3 : Update test. #

Total comments: 22

Patch Set 4 : Address sadrul@'s feedback. #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+350 lines, -0 lines) Patch
M tools/metrics/histograms/histograms.xml View 1 2 3 1 chunk +10 lines, -0 lines 0 comments Download
M ui/aura/window_event_dispatcher.h View 1 2 chunks +4 lines, -0 lines 0 comments Download
M ui/aura/window_event_dispatcher.cc View 1 2 3 1 chunk +5 lines, -0 lines 0 comments Download
M ui/aura/window_event_dispatcher_unittest.cc View 1 2 3 3 chunks +33 lines, -0 lines 0 comments Download
M ui/events/BUILD.gn View 1 2 3 2 chunks +3 lines, -0 lines 0 comments Download
A ui/events/fraction_of_time_without_user_input_recorder.h View 1 2 3 1 chunk +45 lines, -0 lines 1 comment Download
A ui/events/fraction_of_time_without_user_input_recorder.cc View 1 2 3 1 chunk +79 lines, -0 lines 0 comments Download
A ui/events/fraction_of_time_without_user_input_recorder_unittest.cc View 1 2 3 1 chunk +171 lines, -0 lines 0 comments Download
Trybot results: Sign in to try more bots
Commit queue not available (can’t edit this change).

Messages

Total messages: 21 (17 generated)
tdresser
PTAL
1 week ago (2017-03-17 17:44:53 UTC) #18
sadrul
https://codereview.chromium.org/2751403002/diff/40001/ui/aura/window_event_dispatcher.cc File ui/aura/window_event_dispatcher.cc (right): https://codereview.chromium.org/2751403002/diff/40001/ui/aura/window_event_dispatcher.cc#newcode499 ui/aura/window_event_dispatcher.cc:499: event->time_stamp()); Do you care whether the event is actually ...
5 days, 21 hours ago (2017-03-19 00:38:52 UTC) #19
tdresser
Thanks! PTAL https://codereview.chromium.org/2751403002/diff/40001/ui/aura/window_event_dispatcher.cc File ui/aura/window_event_dispatcher.cc (right): https://codereview.chromium.org/2751403002/diff/40001/ui/aura/window_event_dispatcher.cc#newcode499 ui/aura/window_event_dispatcher.cc:499: event->time_stamp()); On 2017/03/19 00:38:51, sadrul wrote: > ...
7 hours ago (2017-03-24 14:56:31 UTC) #20
sadrul
4 hours, 27 minutes ago (2017-03-24 17:29:33 UTC) #21
lgtm

https://codereview.chromium.org/2751403002/diff/40001/ui/events/fraction_of_t...
File ui/events/fraction_of_time_without_user_input_recorder.cc (right):

https://codereview.chromium.org/2751403002/diff/40001/ui/events/fraction_of_t...
ui/events/fraction_of_time_without_user_input_recorder.cc:14: const
base::TimeDelta DEFAULT_IDLE_TIMEOUT =
On 2017/03/24 14:56:30, tdresser wrote:
> On 2017/03/19 00:38:51, sadrul wrote:
> > constexpr
> 
> From https://chromium-cpp.appspot.com/
> 
> "Prefer to const for variables where possible."

I read that as 'Prefer constexpr to const'. Without a constexpr, you are adding
a static initializer.

https://codereview.chromium.org/2751403002/diff/40001/ui/events/fraction_of_t...
File ui/events/fraction_of_time_without_user_input_recorder.h (right):

https://codereview.chromium.org/2751403002/diff/40001/ui/events/fraction_of_t...
ui/events/fraction_of_time_without_user_input_recorder.h:27: base::TimeDelta
idle_timeout_;
On 2017/03/24 14:56:31, tdresser wrote:
> I'm modifying these from the unit test (to keep our tests from failing when we
> tweak these constants).
> 
> To make these members private, I'd need to add protected getters & setters,
and
> then expose the getters publicly on
TestFractionOfTimeWithoutUserInputRecorder,
> which feels like a lot of overhead for very little value.
> 
> Do you think this is worth doing?

I don't really care strongly either way. (although I think the style-guide did
not/does not have an exception for this)

https://codereview.chromium.org/2751403002/diff/60001/ui/events/fraction_of_t...
File ui/events/fraction_of_time_without_user_input_recorder.h (right):

https://codereview.chromium.org/2751403002/diff/60001/ui/events/fraction_of_t...
ui/events/fraction_of_time_without_user_input_recorder.h:31: virtual void
RecordToUma(float idle_fraction) const;
This no longer needs to be virtual.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld d1a128a62