New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 736489 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
not on Chrome anymore
Closed: Jul 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 3
Type: Bug



Sign in to add a comment

Need a UMA metric to log percentage of time when the high resolution timer is activated

Project Member Reported by stanisc@chromium.org, Jun 23 2017

Issue description

System timer frequency has performance implications on Windows.

The goal of this workitem is gain an insight into the usage pattern of the system timer. The plan is to periodically log percentage of time that the system timer frequency is raised for each Chrome process.

It would be better to log the combined system wise state of the system timer but that would require admin privileges. Logging the per-process usage is the best we can do for now.
 
Project Member

Comment 1 by bugdroid1@chromium.org, Jul 6 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/61507093a130b03867bb13996a2af515b67e4972

commit 61507093a130b03867bb13996a2af515b67e4972
Author: stanisc <stanisc@chromium.org>
Date: Thu Jul 06 16:36:58 2017

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}

[modify] https://crrev.com/61507093a130b03867bb13996a2af515b67e4972/base/time/time.h
[modify] https://crrev.com/61507093a130b03867bb13996a2af515b67e4972/base/time/time_win.cc
[modify] https://crrev.com/61507093a130b03867bb13996a2af515b67e4972/base/time/time_win_unittest.cc
[modify] https://crrev.com/61507093a130b03867bb13996a2af515b67e4972/base/timer/hi_res_timer_manager.h
[modify] https://crrev.com/61507093a130b03867bb13996a2af515b67e4972/base/timer/hi_res_timer_manager_posix.cc
[modify] https://crrev.com/61507093a130b03867bb13996a2af515b67e4972/base/timer/hi_res_timer_manager_unittest.cc
[modify] https://crrev.com/61507093a130b03867bb13996a2af515b67e4972/base/timer/hi_res_timer_manager_win.cc
[modify] https://crrev.com/61507093a130b03867bb13996a2af515b67e4972/content/gpu/gpu_main.cc
[modify] https://crrev.com/61507093a130b03867bb13996a2af515b67e4972/tools/metrics/histograms/histograms.xml

Status: Fixed (was: Assigned)

Sign in to add a comment