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

Issue 2951413003: Add UMA for High Resolution Timer Usage (Closed)

Created:
3 years, 6 months ago by stanisc
Modified:
3 years, 5 months ago
CC:
chromium-reviews, danakj+watch_chromium.org, chirantan+watch_chromium.org, asvitkine+watch_chromium.org, vmpstr+watch_chromium.org
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Add UMA for High Resolution Timer Usage The goal of this change is to understand the pattern on activating the high resolution system timer on Windows and to track the improvement when we switch to GPU V-sync and improve task coalescing. The change consists of two parts: 1) In Time class I added two methods that allow to track the high resolution timer activation over an arbitrary time interval: void ResetHighResolutionTimerUsage(); double GetHighResolutionTimerUsage(); The first method resets the accumulated usage value and the second one returns the percentage of time the high resolution timer was activated since the last reset. 2) HighResolutionTimerManager looks like a perfect place to call the two new Time class functions. In general HighResolutionTimerManager takes the snapshot of the usage and logs the UMA metric every 10 minutes. There is a special logic for dealing with suspend / resume because we don't want to count the time when the machine is sleeping. I should mention that when fixing this bug I've noticed that HighResolutionTimerManager was missing in the GPU process. The main responsibility of HighResolutionTimerManager before this change was to change high-resolution timer interval between 1 ms and 4 ms depending on whether the machine is on battery power. The lack of HighResolutionTimerManager in the GPU process could theoretically result in running the high resolution timer at 4 ms interval even when the machine is on AC power. But in reality I think that wouldn't matter because other Chrome processes would likely have more impact on the actual high resolution timer frequency. BUG=736489, 736490 Review-Url: https://codereview.chromium.org/2951413003 Cr-Commit-Position: refs/heads/master@{#484626} Committed: https://chromium.googlesource.com/chromium/src/+/61507093a130b03867bb13996a2af515b67e4972

Patch Set 1 #

Patch Set 2 : Added HiResTimerManager to GPU process and fixed HiResTimerManagerTest.ToggleOnOff test #

Patch Set 3 : Self review #

Patch Set 4 : Added suspend / resume logic #

Total comments: 16

Patch Set 5 : Addressed CR feedback and added TaskManager instantiation in NaCl #

Patch Set 6 : Switched to using Timer in HighResolutionTimerManager #

Total comments: 1

Patch Set 7 : Use RepeatingTimer #

Patch Set 8 : Removed NaCl changes #

Unified diffs Side-by-side diffs Delta from patch set Stats (+162 lines, -9 lines) Patch
M base/time/time.h View 1 2 3 4 1 chunk +13 lines, -1 line 0 comments Download
M base/time/time_win.cc View 1 2 3 chunks +45 lines, -2 lines 0 comments Download
M base/time/time_win_unittest.cc View 1 2 3 4 1 chunk +37 lines, -0 lines 0 comments Download
M base/timer/hi_res_timer_manager.h View 1 2 3 4 5 6 3 chunks +11 lines, -1 line 0 comments Download
M base/timer/hi_res_timer_manager_posix.cc View 1 2 3 1 chunk +4 lines, -0 lines 0 comments Download
M base/timer/hi_res_timer_manager_unittest.cc View 1 2 3 4 2 chunks +3 lines, -2 lines 0 comments Download
M base/timer/hi_res_timer_manager_win.cc View 1 2 3 4 5 6 2 chunks +37 lines, -3 lines 0 comments Download
M content/gpu/gpu_main.cc View 1 2 3 2 chunks +3 lines, -0 lines 0 comments Download
M tools/metrics/histograms/histograms.xml View 1 2 3 4 5 6 1 chunk +9 lines, -0 lines 0 comments Download

Messages

Total messages: 44 (33 generated)
stanisc
gab@chromium.org: Please review changes in base/time and base/timer jbauman@chromium.org: Please review changes in content/gpu/gpu_main.cc rkaplow@chromium.org: ...
3 years, 5 months ago (2017-06-27 01:00:06 UTC) #12
rkaplow
lgtm histogram lg https://codereview.chromium.org/2951413003/diff/60001/tools/metrics/histograms/histograms.xml File tools/metrics/histograms/histograms.xml (right): https://codereview.chromium.org/2951413003/diff/60001/tools/metrics/histograms/histograms.xml#newcode86622 tools/metrics/histograms/histograms.xml:86622: + Percentage of elapsed time the ...
3 years, 5 months ago (2017-06-27 21:49:18 UTC) #16
jbauman
lgtm
3 years, 5 months ago (2017-06-27 21:56:02 UTC) #17
stanisc
https://codereview.chromium.org/2951413003/diff/60001/tools/metrics/histograms/histograms.xml File tools/metrics/histograms/histograms.xml (right): https://codereview.chromium.org/2951413003/diff/60001/tools/metrics/histograms/histograms.xml#newcode86622 tools/metrics/histograms/histograms.xml:86622: + Percentage of elapsed time the high resolution timer ...
3 years, 5 months ago (2017-06-27 22:07:31 UTC) #18
rkaplow1
On 2017/06/27 22:07:31, stanisc wrote: > https://codereview.chromium.org/2951413003/diff/60001/tools/metrics/histograms/histograms.xml > File tools/metrics/histograms/histograms.xml (right): > > https://codereview.chromium.org/2951413003/diff/60001/tools/metrics/histograms/histograms.xml#newcode86622 > ...
3 years, 5 months ago (2017-06-27 22:14:37 UTC) #19
gab
https://codereview.chromium.org/2951413003/diff/60001/base/time/time.h File base/time/time.h (right): https://codereview.chromium.org/2951413003/diff/60001/base/time/time.h#newcode558 base/time/time.h:558: // activated. Also document that Get() is invalid before ...
3 years, 5 months ago (2017-06-28 16:39:32 UTC) #20
gab
https://codereview.chromium.org/2951413003/diff/60001/base/time/time.h File base/time/time.h (right): https://codereview.chromium.org/2951413003/diff/60001/base/time/time.h#newcode558 base/time/time.h:558: // activated. Also document that Get() is invalid before ...
3 years, 5 months ago (2017-06-28 16:39:33 UTC) #21
stanisc
dschuff@chromium.org: OWNER for NaCl changes. gab@, please also review if the way I create TaskScheduler ...
3 years, 5 months ago (2017-06-28 22:28:36 UTC) #29
gab
LGTM w/ nit https://codereview.chromium.org/2951413003/diff/60001/base/timer/hi_res_timer_manager_win.cc File base/timer/hi_res_timer_manager_win.cc (right): https://codereview.chromium.org/2951413003/diff/60001/base/timer/hi_res_timer_manager_win.cc#newcode76 base/timer/hi_res_timer_manager_win.cc:76: ScheduleHighResolutionTimerUsageReport(); On 2017/06/28 22:28:35, stanisc wrote: ...
3 years, 5 months ago (2017-07-01 06:55:30 UTC) #32
commit-bot: I haz the power
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2951413003/140001
3 years, 5 months ago (2017-07-06 16:32:47 UTC) #41
commit-bot: I haz the power
3 years, 5 months ago (2017-07-06 16:37:18 UTC) #44
Message was sent while issue was closed.
Committed patchset #8 (id:140001) as
https://chromium.googlesource.com/chromium/src/+/61507093a130b03867bb13996a2a...

Powered by Google App Engine
This is Rietveld 408576698