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

Issue 2954413004: [GRC] Tab-level CPU Attribution (Closed)

Created:
3 years, 5 months ago by matthalp
Modified:
3 years, 5 months ago
CC:
chromium-reviews, fmeawad
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

[GRC] Tab-level CPU Attribution This CL enabled CPU usage attribution at a tab-level granularity within GRC. Platform CPU usage metrics can only perform measurements at a process-level granularity. To attribute the measured process-level CPU usage measurements to tabs, the following calculation is performed as follows: 1. A render process's CPU usage is equally attributable to all of it's children tabs (i.e. process_cpu_usage / num_tabs). 2. For a tab that uses multiple render processes (i.e. out-of-process iFrames), it's CPU usage is the sum of (1) for each of these render processes. R=lpy@chromium.org,zhenw@chromium.org TBR=oysteine@chromium.org BUG=691886 Review-Url: https://codereview.chromium.org/2954413004 Cr-Commit-Position: refs/heads/master@{#483900} Committed: https://chromium.googlesource.com/chromium/src/+/3668e4d71c7cefe86d1edf8a4e01d1bbaeb5d674

Patch Set 1 #

Patch Set 2 : Add RecalculateProperty to CUs #

Patch Set 3 : Add unittest #

Total comments: 16

Patch Set 4 : Cleanup #

Total comments: 2

Patch Set 5 : Address reviewer feedback #

Patch Set 6 : Address reviewer feedback #

Patch Set 7 : Add frame coordination unit impl #

Total comments: 20

Patch Set 8 : Add unittests #

Patch Set 9 : Address reviewer feedback #

Total comments: 34

Patch Set 10 : Address reviewer feedback #

Patch Set 11 : Update unittest comments #

Total comments: 20

Patch Set 12 : Address reviewer feedback #

Patch Set 13 : Rebase #

Unified diffs Side-by-side diffs Delta from patch set Stats (+660 lines, -46 lines) Patch
M services/resource_coordinator/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +4 lines, -0 lines 0 comments Download
M services/resource_coordinator/coordination_unit/coordination_unit_factory.cc View 1 2 3 4 2 chunks +8 lines, -0 lines 0 comments Download
M services/resource_coordinator/coordination_unit/coordination_unit_impl.h View 1 2 3 4 5 6 7 8 9 3 chunks +40 lines, -16 lines 0 comments Download
M services/resource_coordinator/coordination_unit/coordination_unit_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 3 chunks +71 lines, -5 lines 0 comments Download
M services/resource_coordinator/coordination_unit/coordination_unit_impl_unittest.cc View 1 2 3 4 5 6 7 8 9 10 4 chunks +235 lines, -15 lines 0 comments Download
M services/resource_coordinator/coordination_unit/coordination_unit_impl_unittest_util.h View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +12 lines, -0 lines 0 comments Download
M services/resource_coordinator/coordination_unit/coordination_unit_impl_unittest_util.cc View 1 2 3 4 5 6 7 2 chunks +17 lines, -0 lines 0 comments Download
A services/resource_coordinator/coordination_unit/frame_coordination_unit_impl.h View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +40 lines, -0 lines 0 comments Download
A services/resource_coordinator/coordination_unit/frame_coordination_unit_impl.cc View 1 2 3 4 5 6 7 8 9 1 chunk +48 lines, -0 lines 0 comments Download
M services/resource_coordinator/coordination_unit/process_coordination_unit_impl.h View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +9 lines, -2 lines 0 comments Download
M services/resource_coordinator/coordination_unit/process_coordination_unit_impl.cc View 1 2 3 4 5 6 7 8 9 3 chunks +42 lines, -7 lines 0 comments Download
M services/resource_coordinator/coordination_unit/process_coordination_unit_impl_unittest.cc View 1 2 chunks +4 lines, -1 line 0 comments Download
A services/resource_coordinator/coordination_unit/web_contents_coordination_unit_impl.h View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +45 lines, -0 lines 0 comments Download
A services/resource_coordinator/coordination_unit/web_contents_coordination_unit_impl.cc View 1 2 3 4 5 6 7 8 9 1 chunk +84 lines, -0 lines 0 comments Download
M services/resource_coordinator/public/interfaces/coordination_unit.mojom View 1 1 chunk +1 line, -0 lines 0 comments Download

Dependent Patchsets:

Messages

Total messages: 47 (21 generated)
matthalp
3 years, 5 months ago (2017-06-26 23:39:05 UTC) #3
matthalp
lpy, zhenw PTAL: I have some small enhancements to make still, but it is good ...
3 years, 5 months ago (2017-06-28 04:25:57 UTC) #7
lpy
Thanks for putting up the change, I left some comments, ptal. https://codereview.chromium.org/2954413004/diff/40001/chrome/browser/resource_coordinator/resource_coordinator_web_contents_observer.cc File chrome/browser/resource_coordinator/resource_coordinator_web_contents_observer.cc (right): ...
3 years, 5 months ago (2017-06-28 07:22:53 UTC) #9
matthalp
https://codereview.chromium.org/2954413004/diff/40001/chrome/browser/resource_coordinator/resource_coordinator_web_contents_observer.cc File chrome/browser/resource_coordinator/resource_coordinator_web_contents_observer.cc (right): https://codereview.chromium.org/2954413004/diff/40001/chrome/browser/resource_coordinator/resource_coordinator_web_contents_observer.cc#newcode109 chrome/browser/resource_coordinator/resource_coordinator_web_contents_observer.cc:109: process_resource_coordinator->AddChild(*tab_resource_coordinator_); On 2017/06/28 at 07:22:53, lpy wrote: > should ...
3 years, 5 months ago (2017-06-28 14:38:12 UTC) #10
Zhen Wang
By the way, Nat just added me as an owner of resource_coordinator folder this morning. ...
3 years, 5 months ago (2017-06-28 17:15:16 UTC) #11
lpy
> https://codereview.chromium.org/2954413004/diff/40001/chrome/browser/resource_coordinator/resource_coordinator_web_contents_observer.cc > File > chrome/browser/resource_coordinator/resource_coordinator_web_contents_observer.cc > (right): > > https://codereview.chromium.org/2954413004/diff/40001/chrome/browser/resource_coordinator/resource_coordinator_web_contents_observer.cc#newcode109 > chrome/browser/resource_coordinator/resource_coordinator_web_contents_observer.cc:109: > process_resource_coordinator->AddChild(*tab_resource_coordinator_); ...
3 years, 5 months ago (2017-06-28 17:24:21 UTC) #12
zhenw
On 2017/06/28 17:24:21, lpy wrote: > > > https://codereview.chromium.org/2954413004/diff/40001/chrome/browser/resource_coordinator/resource_coordinator_web_contents_observer.cc > > File > > > ...
3 years, 5 months ago (2017-06-28 17:34:05 UTC) #13
Zhen Wang
Can you also reply the comments in the CL, so we know which ones have ...
3 years, 5 months ago (2017-06-29 20:26:22 UTC) #16
matthalp
All feedback has been responded to and addressed in the code. PTAL https://codereview.chromium.org/2954413004/diff/40001/chrome/browser/resource_coordinator/resource_coordinator_web_contents_observer.cc File chrome/browser/resource_coordinator/resource_coordinator_web_contents_observer.cc ...
3 years, 5 months ago (2017-06-29 22:56:09 UTC) #17
Zhen Wang
Thanks for cleaning this up! It's getting into shape. I have some more comments. https://codereview.chromium.org/2954413004/diff/120001/services/resource_coordinator/coordination_unit/coordination_unit_impl.h ...
3 years, 5 months ago (2017-06-30 16:27:01 UTC) #18
lpy
> https://codereview.chromium.org/2954413004/diff/120001/services/resource_coordinator/coordination_unit/frame_coordination_unit_impl.h > File > services/resource_coordinator/coordination_unit/frame_coordination_unit_impl.h > (right): > > https://codereview.chromium.org/2954413004/diff/120001/services/resource_coordinator/coordination_unit/frame_coordination_unit_impl.h#newcode23 > services/resource_coordinator/coordination_unit/frame_coordination_unit_impl.h:23: > class ...
3 years, 5 months ago (2017-06-30 17:31:37 UTC) #19
matthalp
Feedback has been addressed. PTAL https://codereview.chromium.org/2954413004/diff/120001/services/resource_coordinator/coordination_unit/coordination_unit_impl.h File services/resource_coordinator/coordination_unit/coordination_unit_impl.h (right): https://codereview.chromium.org/2954413004/diff/120001/services/resource_coordinator/coordination_unit/coordination_unit_impl.h#newcode64 services/resource_coordinator/coordination_unit/coordination_unit_impl.h:64: GetAssociatedWebContentsCoordinationUnits(); On 2017/06/30 at ...
3 years, 5 months ago (2017-06-30 18:35:05 UTC) #20
lpy
https://codereview.chromium.org/2954413004/diff/160001/services/resource_coordinator/coordination_unit/frame_coordination_unit_impl.h File services/resource_coordinator/coordination_unit/frame_coordination_unit_impl.h (right): https://codereview.chromium.org/2954413004/diff/160001/services/resource_coordinator/coordination_unit/frame_coordination_unit_impl.h#newcode1 services/resource_coordinator/coordination_unit/frame_coordination_unit_impl.h:1: // Copyright 2017 The Chromium Authors. All rights reserved. ...
3 years, 5 months ago (2017-06-30 19:17:27 UTC) #21
matthalp
https://codereview.chromium.org/2954413004/diff/160001/services/resource_coordinator/coordination_unit/frame_coordination_unit_impl.h File services/resource_coordinator/coordination_unit/frame_coordination_unit_impl.h (right): https://codereview.chromium.org/2954413004/diff/160001/services/resource_coordinator/coordination_unit/frame_coordination_unit_impl.h#newcode1 services/resource_coordinator/coordination_unit/frame_coordination_unit_impl.h:1: // Copyright 2017 The Chromium Authors. All rights reserved. ...
3 years, 5 months ago (2017-06-30 19:22:24 UTC) #22
Zhen Wang
Thanks for adding the tests! https://codereview.chromium.org/2954413004/diff/160001/services/resource_coordinator/coordination_unit/coordination_unit_impl.cc File services/resource_coordinator/coordination_unit/coordination_unit_impl.cc (right): https://codereview.chromium.org/2954413004/diff/160001/services/resource_coordinator/coordination_unit/coordination_unit_impl.cc#newcode273 services/resource_coordinator/coordination_unit/coordination_unit_impl.cc:273: child->GetChildCoordinationUnitsOfType(type)) { Why do ...
3 years, 5 months ago (2017-06-30 19:54:10 UTC) #23
lpy
On 2017/06/30 19:22:24, matthalp wrote: > https://codereview.chromium.org/2954413004/diff/160001/services/resource_coordinator/coordination_unit/frame_coordination_unit_impl.h > File > services/resource_coordinator/coordination_unit/frame_coordination_unit_impl.h > (right): > > ...
3 years, 5 months ago (2017-06-30 19:54:52 UTC) #24
matthalp
PTAL https://codereview.chromium.org/2954413004/diff/160001/services/resource_coordinator/coordination_unit/coordination_unit_impl.cc File services/resource_coordinator/coordination_unit/coordination_unit_impl.cc (right): https://codereview.chromium.org/2954413004/diff/160001/services/resource_coordinator/coordination_unit/coordination_unit_impl.cc#newcode273 services/resource_coordinator/coordination_unit/coordination_unit_impl.cc:273: child->GetChildCoordinationUnitsOfType(type)) { On 2017/06/30 at 19:54:07, Zhen Wang ...
3 years, 5 months ago (2017-06-30 22:03:56 UTC) #25
lpy
lgtm from my side :) please wait for Zhen's feedback.
3 years, 5 months ago (2017-06-30 23:27:41 UTC) #26
lpy
+estark@ for security review on mojom. estark@, ptal.
3 years, 5 months ago (2017-06-30 23:28:20 UTC) #28
estark
mojom lgtm
3 years, 5 months ago (2017-06-30 23:35:52 UTC) #29
Zhen Wang
LGTM with nits https://codereview.chromium.org/2954413004/diff/200001/services/resource_coordinator/coordination_unit/coordination_unit_impl.cc File services/resource_coordinator/coordination_unit/coordination_unit_impl.cc (right): https://codereview.chromium.org/2954413004/diff/200001/services/resource_coordinator/coordination_unit/coordination_unit_impl.cc#newcode303 services/resource_coordinator/coordination_unit/coordination_unit_impl.cc:303: return std::set<CoordinationUnitImpl*>(); I think we still ...
3 years, 5 months ago (2017-06-30 23:37:50 UTC) #30
Zhen Wang
LGTM with nits https://codereview.chromium.org/2954413004/diff/200001/services/resource_coordinator/coordination_unit/coordination_unit_impl.cc File services/resource_coordinator/coordination_unit/coordination_unit_impl.cc (right): https://codereview.chromium.org/2954413004/diff/200001/services/resource_coordinator/coordination_unit/coordination_unit_impl.cc#newcode303 services/resource_coordinator/coordination_unit/coordination_unit_impl.cc:303: return std::set<CoordinationUnitImpl*>(); I think we still ...
3 years, 5 months ago (2017-06-30 23:37:51 UTC) #31
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/2954413004/240001
3 years, 5 months ago (2017-07-01 03:34:48 UTC) #42
commit-bot: I haz the power
Committed patchset #13 (id:240001) as https://chromium.googlesource.com/chromium/src/+/3668e4d71c7cefe86d1edf8a4e01d1bbaeb5d674
3 years, 5 months ago (2017-07-01 03:39:44 UTC) #45
Zhen Wang
https://codereview.chromium.org/2954413004/diff/200001/services/resource_coordinator/coordination_unit/coordination_unit_impl.h File services/resource_coordinator/coordination_unit/coordination_unit_impl.h (right): https://codereview.chromium.org/2954413004/diff/200001/services/resource_coordinator/coordination_unit/coordination_unit_impl.h#newcode60 services/resource_coordinator/coordination_unit/coordination_unit_impl.h:60: // by invoking their their |RecalculateProperty|. On 2017/06/30 23:37:50, ...
3 years, 5 months ago (2017-07-01 15:55:37 UTC) #46
matthalp
3 years, 5 months ago (2017-07-01 15:56:27 UTC) #47
Message was sent while issue was closed.
https://codereview.chromium.org/2954413004/diff/200001/services/resource_coor...
File services/resource_coordinator/coordination_unit/coordination_unit_impl.cc
(right):

https://codereview.chromium.org/2954413004/diff/200001/services/resource_coor...
services/resource_coordinator/coordination_unit/coordination_unit_impl.cc:303:
return std::set<CoordinationUnitImpl*>();
On 2017/06/30 at 23:37:50, Zhen Wang wrote:
> I think we still need NOTREACHED() here to prevent this being called?

Done.

https://codereview.chromium.org/2954413004/diff/200001/services/resource_coor...
File services/resource_coordinator/coordination_unit/coordination_unit_impl.h
(right):

https://codereview.chromium.org/2954413004/diff/200001/services/resource_coor...
services/resource_coordinator/coordination_unit/coordination_unit_impl.h:60: //
by invoking their their |RecalculateProperty|.
On 2017/06/30 at 23:37:50, Zhen Wang wrote:
> nit:
> 1. duplicated "their"
> 2. not need to mention "by invoking ...". That is internal details.

Done.

https://codereview.chromium.org/2954413004/diff/200001/services/resource_coor...
services/resource_coordinator/coordination_unit/coordination_unit_impl.h:61:
virtual void PropagateProperty(mojom::PropertyType property) {}
On 2017/06/30 at 23:37:50, Zhen Wang wrote:
> This is not used any where in the CL? Just remove it for now. Add later when
using it.

Done.

https://codereview.chromium.org/2954413004/diff/200001/services/resource_coor...
File
services/resource_coordinator/coordination_unit/coordination_unit_impl_unittest.cc
(right):

https://codereview.chromium.org/2954413004/diff/200001/services/resource_coor...
services/resource_coordinator/coordination_unit/coordination_unit_impl_unittest.cc:344:
// OP: other_process_coordination_unit
On 2017/06/30 at 23:37:50, Zhen Wang wrote:
> Thanks for the comments here!

No problem!

https://codereview.chromium.org/2954413004/diff/200001/services/resource_coor...
File
services/resource_coordinator/coordination_unit/coordination_unit_impl_unittest_util.h
(right):

https://codereview.chromium.org/2954413004/diff/200001/services/resource_coor...
services/resource_coordinator/coordination_unit/coordination_unit_impl_unittest_util.h:21:
enum class CoordinationUnitType : uint8_t;
On 2017/06/30 at 23:37:50, Zhen Wang wrote:
> Why is this needed? Can't we just include coordination_unit_types.h?

Done.

https://codereview.chromium.org/2954413004/diff/200001/services/resource_coor...
File
services/resource_coordinator/coordination_unit/frame_coordination_unit_impl.h
(right):

https://codereview.chromium.org/2954413004/diff/200001/services/resource_coor...
services/resource_coordinator/coordination_unit/frame_coordination_unit_impl.h:22:
enum class CoordinationUnitType : uint8_t;
On 2017/06/30 at 23:37:51, Zhen Wang wrote:
> Why is this needed? Can't we just include coordination_unit_types.h?

Done.

https://codereview.chromium.org/2954413004/diff/200001/services/resource_coor...
File
services/resource_coordinator/coordination_unit/process_coordination_unit_impl.h
(right):

https://codereview.chromium.org/2954413004/diff/200001/services/resource_coor...
services/resource_coordinator/coordination_unit/process_coordination_unit_impl.h:25:
enum class CoordinationUnitType : uint8_t;
On 2017/06/30 at 23:37:51, Zhen Wang wrote:
> Why is this needed? Can't we just include coordination_unit_types.h?

Done.

https://codereview.chromium.org/2954413004/diff/200001/services/resource_coor...
File
services/resource_coordinator/coordination_unit/web_contents_coordination_unit_impl.cc
(right):

https://codereview.chromium.org/2954413004/diff/200001/services/resource_coor...
services/resource_coordinator/coordination_unit/web_contents_coordination_unit_impl.cc:28:
case CoordinationUnitType::kProcess: {
On 2017/06/30 at 23:37:51, Zhen Wang wrote:
> nit: I guess we do not need this "{" (and "}" on line 45)?

The compiler complains if the braces are removed. Let's revisit moving them in a
future CL.

https://codereview.chromium.org/2954413004/diff/200001/services/resource_coor...
File
services/resource_coordinator/coordination_unit/web_contents_coordination_unit_impl.h
(right):

https://codereview.chromium.org/2954413004/diff/200001/services/resource_coor...
services/resource_coordinator/coordination_unit/web_contents_coordination_unit_impl.h:24:
enum class CoordinationUnitType : uint8_t;
On 2017/06/30 at 23:37:51, Zhen Wang wrote:
> Why is this needed? Can't we just include coordination_unit_types.h?

Done.

Powered by Google App Engine
This is Rietveld 408576698