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}


CrOS-Libchrome-Original-Commit: 61507093a130b03867bb13996a2af515b67e4972
4 files changed
tree: 7b1d676a8d666f9e292a1d0c0e8fc9caedbc5f92
  1. base/
  2. build/
  3. components/
  4. dbus/
  5. device/
  6. ipc/
  7. mojo/
  8. testing/
  9. third_party/
  10. ui/