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

Issue 560553005: Battery impact UMA (Closed)

Created:
6 years, 3 months ago by jeremy
Modified:
6 years, 1 month ago
CC:
chromium-reviews, Ilya Sherman, asvitkine+watch_chromium.org, tonyg, sullivan, oysteine, sadrul, timvolodine, qsr, blundell
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Project:
chromium
Visibility:
Public.

Description

Report UMA stats on battery discharge rate when Chrome is running. Stats reported: * Battery depletion percent over 5, 15 and 30 minute period. * Battery discharge rate if battery was discharged for more than 30 minutes. Reports are only generated after 30 minutes of uptime so as not to be affected by increased power draw at system startup. In-progress stat collection is cancelled on sleep or when all renderers are closed. BUG=418407 Committed: https://crrev.com/76a267615a7bc5fcb76f3a6c425c57eb99b66745 Cr-Commit-Position: refs/heads/master@{#304412}

Patch Set 1 #

Patch Set 2 : Move to content/ #

Total comments: 6

Patch Set 3 : Fix review comments #

Total comments: 12

Patch Set 4 : WIP #

Patch Set 5 : Now with unit tests #

Total comments: 57

Patch Set 6 : Fix review comments #

Patch Set 7 : Minor style fixes. #

Total comments: 40

Patch Set 8 : Fix review comments #

Total comments: 35

Patch Set 9 : Fix review comments + Rebase #

Patch Set 10 : Fix review comments #

Patch Set 11 : Remove rate limiting + Move everything to main thread. #

Total comments: 32

Patch Set 12 : Fix review comments #

Patch Set 13 : Additional style fixes #

Total comments: 13

Patch Set 14 : Fix review comments #

Patch Set 15 : Remove debug code #

Total comments: 6

Patch Set 16 : Rate -> PercentPerHour #

Total comments: 8

Patch Set 17 : Fix review comments #

Total comments: 4

Patch Set 18 : Fix histograms.xml #

Patch Set 19 : Fix unrelated change that snuck in. #

Patch Set 20 : Pach for landing #

Patch Set 21 : Fix component build. #

Total comments: 8

Patch Set 22 : Fix review comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+655 lines, -6 lines) Patch
M chrome/browser/chrome_browser_main.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 2 chunks +6 lines, -0 lines 0 comments Download
A content/browser/power_usage_monitor_impl.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 1 chunk +133 lines, -0 lines 0 comments Download
A content/browser/power_usage_monitor_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 1 chunk +276 lines, -0 lines 0 comments Download
A content/browser/power_usage_monitor_impl_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 chunk +167 lines, -0 lines 0 comments Download
M content/content_browser.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 1 chunk +2 lines, -0 lines 0 comments Download
M content/content_tests.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 3 chunks +6 lines, -1 line 0 comments Download
A + content/public/browser/power_usage_monitor.h View 1 2 3 4 5 1 chunk +5 lines, -5 lines 0 comments Download
M tools/metrics/histograms/histograms.xml View 2 chunks +60 lines, -0 lines 0 comments Download

Messages

Total messages: 63 (11 generated)
jeremy
Not ready yet, but would be grateful for high level feedback. The main piece that's ...
6 years, 3 months ago (2014-09-15 05:42:31 UTC) #2
jeremy
Something else I've been thinking about - what should we do in the face of ...
6 years, 3 months ago (2014-09-15 08:08:55 UTC) #3
sullivan
On 2014/09/15 08:08:55, jeremy wrote: > Something else I've been thinking about - what should ...
6 years, 3 months ago (2014-09-15 16:26:58 UTC) #4
tonyg
On 2014/09/15 16:26:58, sullivan wrote: > On 2014/09/15 08:08:55, jeremy wrote: > > Something else ...
6 years, 3 months ago (2014-09-15 16:58:58 UTC) #6
jeremy
derat/avi: Can you review this please? This still needs polish and tests but I'd really ...
6 years, 3 months ago (2014-09-22 05:58:40 UTC) #8
Daniel Erat
(i just looked at a little of it before having the following question.) is there ...
6 years, 3 months ago (2014-09-22 16:10:20 UTC) #9
jeremy
Thanks for looking Daniel, I've filed a tracking bug, a detailed explanation is in the ...
6 years, 2 months ago (2014-09-29 06:27:15 UTC) #10
Daniel Erat
still just a partial review, but here are some more comments https://codereview.chromium.org/560553005/diff/40001/content/browser/power_usage_monitor_impl.cc File content/browser/power_usage_monitor_impl.cc (right): ...
6 years, 2 months ago (2014-09-30 23:55:25 UTC) #11
jeremy
All review comments fixed, ready for a thorough review, thanks!
6 years, 2 months ago (2014-10-21 14:55:14 UTC) #12
oystein (OOO til 10th of July)
On 2014/10/21 14:55:14, jeremy wrote: > All review comments fixed, ready for a thorough review, ...
6 years, 2 months ago (2014-10-21 15:09:05 UTC) #13
Avi (use Gerrit)
https://codereview.chromium.org/560553005/diff/100001/content/browser/power_usage_monitor_impl.cc File content/browser/power_usage_monitor_impl.cc (right): https://codereview.chromium.org/560553005/diff/100001/content/browser/power_usage_monitor_impl.cc#newcode115 content/browser/power_usage_monitor_impl.cc:115: // Called on IO thread. DCHECK it then. https://codereview.chromium.org/560553005/diff/100001/content/browser/power_usage_monitor_impl.cc#newcode140 ...
6 years, 2 months ago (2014-10-21 15:12:50 UTC) #14
Daniel Erat
i didn't look at the tests yet. https://codereview.chromium.org/560553005/diff/100001/chrome/browser/chrome_browser_main.cc File chrome/browser/chrome_browser_main.cc (right): https://codereview.chromium.org/560553005/diff/100001/chrome/browser/chrome_browser_main.cc#newcode1558 chrome/browser/chrome_browser_main.cc:1558: content::StartPowerUsageMonitor(); is ...
6 years, 2 months ago (2014-10-21 16:01:22 UTC) #15
jeremy
On 2014/10/21 15:09:05, Oystein wrote: > On 2014/10/21 14:55:14, jeremy wrote: > > All review ...
6 years, 2 months ago (2014-10-22 07:12:00 UTC) #16
jeremy
Thanks for the quick review in the previous round! Everything should now be fixed, ready ...
6 years, 2 months ago (2014-10-23 14:32:47 UTC) #17
Daniel Erat
https://codereview.chromium.org/560553005/diff/140001/chrome/browser/chrome_browser_main.cc File chrome/browser/chrome_browser_main.cc (right): https://codereview.chromium.org/560553005/diff/140001/chrome/browser/chrome_browser_main.cc#newcode1557 chrome/browser/chrome_browser_main.cc:1557: #if !defined(OS_LINUX) // http://crbug.com/426393 i think that this incorrectly ...
6 years, 2 months ago (2014-10-23 19:05:35 UTC) #18
jeremy
Ready for another look, have you looked over the unit tests yet? Many thanks! https://codereview.chromium.org/560553005/diff/140001/chrome/browser/chrome_browser_main.cc ...
6 years, 1 month ago (2014-10-27 08:25:12 UTC) #19
Daniel Erat
(still haven't looked at tests) re this earlier reply: "This is not uniform across systems, ...
6 years, 1 month ago (2014-10-27 16:15:59 UTC) #20
Daniel Erat
whoops, meant to cc sadrul about the blink/content question.
6 years, 1 month ago (2014-10-27 19:11:51 UTC) #21
sadrul
https://codereview.chromium.org/560553005/diff/160001/content/browser/power_usage_monitor_impl.h File content/browser/power_usage_monitor_impl.h (right): https://codereview.chromium.org/560553005/diff/160001/content/browser/power_usage_monitor_impl.h#newcode18 content/browser/power_usage_monitor_impl.h:18: #include "third_party/WebKit/public/platform/WebBatteryStatus.h" On 2014/10/27 16:15:58, Daniel Erat wrote: > ...
6 years, 1 month ago (2014-10-27 20:57:39 UTC) #22
timvolodine
https://codereview.chromium.org/560553005/diff/160001/content/browser/power_usage_monitor_impl.cc File content/browser/power_usage_monitor_impl.cc (right): https://codereview.chromium.org/560553005/diff/160001/content/browser/power_usage_monitor_impl.cc#newcode14 content/browser/power_usage_monitor_impl.cc:14: #include "base/time/time.h" no need to include this, it's already ...
6 years, 1 month ago (2014-10-28 23:44:03 UTC) #24
jeremy
Ready for another look, thanks! > have you confirmed that you'll actually be able to ...
6 years, 1 month ago (2014-11-02 15:06:21 UTC) #25
jeremy
On second thoughts, can you please hold off with another round of review - there ...
6 years, 1 month ago (2014-11-03 14:17:06 UTC) #26
jeremy
Ready for another round, changes: * Moved everything to the UI thread per API changes, ...
6 years, 1 month ago (2014-11-04 11:54:08 UTC) #27
Daniel Erat
https://codereview.chromium.org/560553005/diff/220001/content/browser/power_usage_monitor_impl.cc File content/browser/power_usage_monitor_impl.cc (right): https://codereview.chromium.org/560553005/diff/220001/content/browser/power_usage_monitor_impl.cc#newcode11 content/browser/power_usage_monitor_impl.cc:11: #include "base/message_loop/message_loop.h" don't think you're using this now https://codereview.chromium.org/560553005/diff/220001/content/browser/power_usage_monitor_impl.cc#newcode32 ...
6 years, 1 month ago (2014-11-04 17:04:03 UTC) #28
jeremy
All fixed, ready for another look. Additional changes: * A couple of new unit tests. ...
6 years, 1 month ago (2014-11-05 11:40:20 UTC) #29
Daniel Erat
https://codereview.chromium.org/560553005/diff/260001/content/browser/power_usage_monitor_impl.cc File content/browser/power_usage_monitor_impl.cc (right): https://codereview.chromium.org/560553005/diff/260001/content/browser/power_usage_monitor_impl.cc#newcode138 content/browser/power_usage_monitor_impl.cc:138: base::TimeDelta::FromMinutes(kMinUptimeMinutes - uptime.InMinutes()); just do base::TimeDelta::FromMinutes(kMinUptimeMinutes) - uptime, or ...
6 years, 1 month ago (2014-11-05 17:17:20 UTC) #30
jeremy
Thanks Dan! These seem like small issues and I'm anxious to get this landed soon ...
6 years, 1 month ago (2014-11-05 18:50:56 UTC) #31
Daniel Erat
i don't think i had any other large comments; thanks for checking.
6 years, 1 month ago (2014-11-05 19:07:13 UTC) #32
Avi (use Gerrit)
lgtm https://codereview.chromium.org/560553005/diff/260001/content/browser/power_usage_monitor_impl.cc File content/browser/power_usage_monitor_impl.cc (right): https://codereview.chromium.org/560553005/diff/260001/content/browser/power_usage_monitor_impl.cc#newcode150 content/browser/power_usage_monitor_impl.cc:150: CHECK(!started_); Why all the CHECKs rather than DCHECKs? ...
6 years, 1 month ago (2014-11-05 20:56:29 UTC) #33
jeremy
Jochen: Owner review for chrome/browser please. All fixed, ready for another look https://codereview.chromium.org/560553005/diff/260001/content/browser/power_usage_monitor_impl.cc File content/browser/power_usage_monitor_impl.cc ...
6 years, 1 month ago (2014-11-06 17:12:56 UTC) #35
Daniel Erat
thanks, the code lgtm now. i'm adding mpearson@ as a reviewer since i still have ...
6 years, 1 month ago (2014-11-06 17:22:43 UTC) #37
Mark P
https://codereview.chromium.org/560553005/diff/300001/content/browser/power_usage_monitor_impl.h File content/browser/power_usage_monitor_impl.h (right): https://codereview.chromium.org/560553005/diff/300001/content/browser/power_usage_monitor_impl.h#newcode52 content/browser/power_usage_monitor_impl.h:52: // discern interesting changes in discharge rate. On 2014/11/06 ...
6 years, 1 month ago (2014-11-06 18:50:04 UTC) #38
Daniel Erat
i think that you also ought to add the histograms to tools/metrics/histograms/histograms.xml as part of ...
6 years, 1 month ago (2014-11-06 18:54:15 UTC) #39
Daniel Erat
https://codereview.chromium.org/560553005/diff/300001/content/browser/power_usage_monitor_impl.h File content/browser/power_usage_monitor_impl.h (right): https://codereview.chromium.org/560553005/diff/300001/content/browser/power_usage_monitor_impl.h#newcode24 content/browser/power_usage_monitor_impl.h:24: // * Power.BatteryDischarge_{5,15,30} - delta between battery level when ...
6 years, 1 month ago (2014-11-06 18:56:20 UTC) #40
Mark P
https://codereview.chromium.org/560553005/diff/300001/content/browser/power_usage_monitor_impl.h File content/browser/power_usage_monitor_impl.h (right): https://codereview.chromium.org/560553005/diff/300001/content/browser/power_usage_monitor_impl.h#newcode52 content/browser/power_usage_monitor_impl.h:52: // discern interesting changes in discharge rate. On 2014/11/06 ...
6 years, 1 month ago (2014-11-06 19:33:34 UTC) #41
jeremy
Nico: Can you do an owner review of chrome_browser_main please? https://codereview.chromium.org/560553005/diff/300001/content/browser/power_usage_monitor_impl.h File content/browser/power_usage_monitor_impl.h (right): https://codereview.chromium.org/560553005/diff/300001/content/browser/power_usage_monitor_impl.h#newcode52 ...
6 years, 1 month ago (2014-11-09 13:49:27 UTC) #43
Daniel Erat
a few more comments, but still lgtm after this https://codereview.chromium.org/560553005/diff/320001/content/browser/power_usage_monitor_impl.cc File content/browser/power_usage_monitor_impl.cc (right): https://codereview.chromium.org/560553005/diff/320001/content/browser/power_usage_monitor_impl.cc#newcode195 content/browser/power_usage_monitor_impl.cc:195: ...
6 years, 1 month ago (2014-11-09 17:07:15 UTC) #44
jeremy
thakis/mpearson: lgty? (Thanks Daniel!)
6 years, 1 month ago (2014-11-09 17:14:56 UTC) #45
jeremy
https://codereview.chromium.org/560553005/diff/320001/content/browser/power_usage_monitor_impl.cc File content/browser/power_usage_monitor_impl.cc (right): https://codereview.chromium.org/560553005/diff/320001/content/browser/power_usage_monitor_impl.cc#newcode195 content/browser/power_usage_monitor_impl.cc:195: double discharge_hours = discharge_time.InMinutes() / 60.0; On 2014/11/09 17:07:14, ...
6 years, 1 month ago (2014-11-10 06:08:47 UTC) #46
Nico
browser/chrome_browser_main.cc lgtm
6 years, 1 month ago (2014-11-10 17:41:41 UTC) #47
Mark P
Lots of comments in histograms.xml Sorry for the possible incoherence; I'm not entirely awake. https://codereview.chromium.org/560553005/diff/340001/tools/metrics/histograms/histograms.xml ...
6 years, 1 month ago (2014-11-10 18:08:36 UTC) #48
jeremy
mpearson: Fixed histogram.xml description and removed cancelled histogram per offline discussion.
6 years, 1 month ago (2014-11-11 10:19:14 UTC) #49
Mark P
lgtm histograms.xml lgtm
6 years, 1 month ago (2014-11-12 19:06:02 UTC) #50
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/560553005/400001
6 years, 1 month ago (2014-11-16 11:58:28 UTC) #52
commit-bot: I haz the power
Try jobs failed on following builders: mac_chromium_compile_dbg on tryserver.chromium.mac (http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_compile_dbg/builds/34626)
6 years, 1 month ago (2014-11-16 12:23:25 UTC) #54
jeremy
ppi: Could you please confirm my change to content_tests.gypi in patchset #21 is correct? I'm ...
6 years, 1 month ago (2014-11-16 15:34:02 UTC) #56
ppi
Ouch, I think we're working on conflicting things. Please take a look at the comments ...
6 years, 1 month ago (2014-11-16 16:03:08 UTC) #57
jeremy
https://codereview.chromium.org/560553005/diff/420001/content/browser/power_usage_monitor_impl.h File content/browser/power_usage_monitor_impl.h (right): https://codereview.chromium.org/560553005/diff/420001/content/browser/power_usage_monitor_impl.h#newcode96 content/browser/power_usage_monitor_impl.h:96: scoped_ptr<device::BatteryStatusService::BatteryUpdateSubscription> Thanks, wasn't aware of that. Unless you are ...
6 years, 1 month ago (2014-11-17 07:50:48 UTC) #58
ppi
lgtm https://codereview.chromium.org/560553005/diff/420001/content/browser/power_usage_monitor_impl.h File content/browser/power_usage_monitor_impl.h (right): https://codereview.chromium.org/560553005/diff/420001/content/browser/power_usage_monitor_impl.h#newcode96 content/browser/power_usage_monitor_impl.h:96: scoped_ptr<device::BatteryStatusService::BatteryUpdateSubscription> On 2014/11/17 07:50:48, jeremy wrote: > Thanks, ...
6 years, 1 month ago (2014-11-17 10:51:01 UTC) #59
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/560553005/440001
6 years, 1 month ago (2014-11-17 11:14:02 UTC) #61
commit-bot: I haz the power
Committed patchset #22 (id:440001)
6 years, 1 month ago (2014-11-17 12:09:47 UTC) #62
commit-bot: I haz the power
6 years, 1 month ago (2014-11-17 12:10:30 UTC) #63
Message was sent while issue was closed.
Patchset 22 (id:??) landed as
https://crrev.com/76a267615a7bc5fcb76f3a6c425c57eb99b66745
Cr-Commit-Position: refs/heads/master@{#304412}

Powered by Google App Engine
This is Rietveld 408576698