New issue
Advanced search Search tips

Issue 782953 link

Starred by 1 user

Issue metadata

Status: Verified
Owner:
Closed: Jan 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 2
Type: Feature



Sign in to add a comment

Report stats about inactivity-triggered power management events

Project Member Reported by derat@chromium.org, Nov 8 2017

Issue description

It's difficult to reason about the impact of proposed changes to our power management logic (e.g.  issue 782725 , http://doc/1CBIQPj-7WBox06z9Wx39fDGOmlWxD4E88HEvjnY8DMg/edit).

I think we should report histogram metrics about various inactivity-triggered actions that powerd performs, maybe along the lines of the following to start out with:

Power.IdleScreenDimDaily
Power.IdleScreenOffDaily
Power.IdleSuspendDaily

(I don't think it's possible to track inactivity-triggered screen-locking in Chrome right now, but I'm also not sure that it's an interesting thing to measure.)

Chrome has code to help perform actions (roughly) daily at components/metrics/daily_event.h; see chrome/browser/metrics/tab_stats_tracker.cc for an example use of it to report metrics.

Is it also useful to report:

a) total daily time spent in screen-dimmed and screen-off states, and
b) total daily time spent in screen-dimmed and screen-off states only when it results in the system suspending

?
 

Comment 1 Deleted

jia, did you intend to delete your response here?
Yes, I did, now I'm using the correct account under chromium.org. :)

I guess I don't need to re-post my comment now, as we've discussed the issue in the attached doc.

Thanks for generating additional metrics, super helpful indeed. :)

Comment 4 by derat@chromium.org, Nov 10 2017

Sent https://crrev.com/c/762259 to add the first three histograms mentioned in the original description. I've renamed them:

Power.IdleScreenDimCountDaily
Power.IdleScreenOffCountDaily
Power.IdleSuspendCountDaily
Project Member

Comment 5 by bugdroid1@chromium.org, Nov 14 2017

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

commit eb06a79f5b790460b50c49b69ec0966aa7f354a1
Author: Daniel Erat <derat@chromium.org>
Date: Tue Nov 14 22:30:51 2017

metrics: Make DailyEvent pass reason to observers.

Make metrics::DailyEvent pass observers the reason that it's
notifying them. This allows observers to e.g. ignore
first-run notifications if they only want to report metrics
when a full day has passed.

Bug:  782953 
Change-Id: I19b7bd627f56563d59dd102bb234c0e759eecb4a
Reviewed-on: https://chromium-review.googlesource.com/766549
Reviewed-by: Steven Holte <holte@chromium.org>
Reviewed-by: Michael Giuffrida <michaelpg@chromium.org>
Commit-Queue: Dan Erat <derat@chromium.org>
Cr-Commit-Position: refs/heads/master@{#516467}
[modify] https://crrev.com/eb06a79f5b790460b50c49b69ec0966aa7f354a1/chrome/browser/metrics/tab_stats_tracker.cc
[modify] https://crrev.com/eb06a79f5b790460b50c49b69ec0966aa7f354a1/chrome/browser/metrics/tab_stats_tracker.h
[modify] https://crrev.com/eb06a79f5b790460b50c49b69ec0966aa7f354a1/components/metrics/daily_event.cc
[modify] https://crrev.com/eb06a79f5b790460b50c49b69ec0966aa7f354a1/components/metrics/daily_event.h
[modify] https://crrev.com/eb06a79f5b790460b50c49b69ec0966aa7f354a1/components/metrics/daily_event_unittest.cc

Project Member

Comment 6 by bugdroid1@chromium.org, Nov 16 2017

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

commit 645c865295fdd5bb0762a1ad4f7238ccc03fcce3
Author: Daniel Erat <derat@chromium.org>
Date: Thu Nov 16 00:01:57 2017

chromeos: Report daily power management metrics.

Add a PowerMetricsReporter class that reports
new power-management-related histograms:

Power.IdleScreenDimCountDaily
Power.IdleScreenOffCountDaily
Power.IdleSuspendCountDaily

These events' counts are reported once per day.

Bug:  782953 
Change-Id: Icafc451c5e05d98d9597deb8a6a12da5c86d3354
Reviewed-on: https://chromium-review.googlesource.com/762259
Reviewed-by: Michael Giuffrida <michaelpg@chromium.org>
Reviewed-by: Scott Violet <sky@chromium.org>
Reviewed-by: Ilya Sherman <isherman@chromium.org>
Commit-Queue: Dan Erat <derat@chromium.org>
Cr-Commit-Position: refs/heads/master@{#516903}
[modify] https://crrev.com/645c865295fdd5bb0762a1ad4f7238ccc03fcce3/chrome/browser/chromeos/BUILD.gn
[modify] https://crrev.com/645c865295fdd5bb0762a1ad4f7238ccc03fcce3/chrome/browser/chromeos/chrome_browser_main_chromeos.cc
[modify] https://crrev.com/645c865295fdd5bb0762a1ad4f7238ccc03fcce3/chrome/browser/chromeos/chrome_browser_main_chromeos.h
[add] https://crrev.com/645c865295fdd5bb0762a1ad4f7238ccc03fcce3/chrome/browser/chromeos/power/power_metrics_reporter.cc
[add] https://crrev.com/645c865295fdd5bb0762a1ad4f7238ccc03fcce3/chrome/browser/chromeos/power/power_metrics_reporter.h
[add] https://crrev.com/645c865295fdd5bb0762a1ad4f7238ccc03fcce3/chrome/browser/chromeos/power/power_metrics_reporter_unittest.cc
[modify] https://crrev.com/645c865295fdd5bb0762a1ad4f7238ccc03fcce3/chrome/browser/prefs/browser_prefs.cc
[modify] https://crrev.com/645c865295fdd5bb0762a1ad4f7238ccc03fcce3/chrome/common/pref_names.cc
[modify] https://crrev.com/645c865295fdd5bb0762a1ad4f7238ccc03fcce3/chrome/common/pref_names.h
[modify] https://crrev.com/645c865295fdd5bb0762a1ad4f7238ccc03fcce3/chromeos/dbus/fake_power_manager_client.cc
[modify] https://crrev.com/645c865295fdd5bb0762a1ad4f7238ccc03fcce3/chromeos/dbus/fake_power_manager_client.h
[modify] https://crrev.com/645c865295fdd5bb0762a1ad4f7238ccc03fcce3/tools/metrics/histograms/histograms.xml

Project Member

Comment 7 by bugdroid1@chromium.org, Nov 21 2017

Comment 8 by derat@chromium.org, Jan 26 2018

Status: Verified (was: Started)
I'm going to pass on adding Chrome time-spent-in-state metrics unless someone has a use for them.

Sign in to add a comment