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

Issue 2964103002: [GRC] Decouple Render Process CPU Measurement from CU Graph (Closed)

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

Description

[GRC] Decouple Process CPU Measurement from CU Graph Currently GRC's process CPU measurement mechanisms are tightly integrated with the process coordination unit implementation. This CL moves the CPU usage measurement from the resource_coordinator service to the content_browser service. Abstraction Improvements: Decoupling process CPU measurement from the CU model allows the coordination units to focus on representing browser state within GRC, rather than updating it. In GRC terms, the migrated render process CPU measurement infrastructure is a "probe" that externally triggers updates the CU graph. Code Health Improvements: The measurement decoupling makes the coordination unit graph more easily testable. To that end, coordination unit graph mocks have been created to address the repeating pattern of needing a given coordination unit graph topology for (unit)testing). R=lpy@chromium.org,zhenw@chromium.org TBR=oysteine@chromium.org BUG=691886

Patch Set 1 #

Patch Set 2 : Rebase #

Patch Set 3 : Update unittests #

Total comments: 1

Patch Set 4 : Rebase #

Total comments: 3
Unified diffs Side-by-side diffs Delta from patch set Stats (+539 lines, -282 lines) Patch
M chrome/browser/BUILD.gn View 1 2 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/browser/chrome_browser_main.cc View 1 2 chunks +3 lines, -0 lines 0 comments Download
A chrome/browser/resource_coordinator/resource_coordinator_render_process_probe.h View 1 1 chunk +66 lines, -0 lines 1 comment Download
A chrome/browser/resource_coordinator/resource_coordinator_render_process_probe.cc View 1 2 3 1 chunk +108 lines, -0 lines 1 comment Download
M services/resource_coordinator/BUILD.gn View 1 2 1 chunk +3 lines, -1 line 0 comments Download
M services/resource_coordinator/coordination_unit/coordination_unit_impl.h View 1 2 2 chunks +5 lines, -2 lines 1 comment Download
M services/resource_coordinator/coordination_unit/coordination_unit_impl.cc View 1 2 1 chunk +11 lines, -0 lines 0 comments Download
M services/resource_coordinator/coordination_unit/coordination_unit_impl_unittest.cc View 1 2 3 3 chunks +42 lines, -174 lines 0 comments Download
A services/resource_coordinator/coordination_unit/mock_coordination_unit_graphs.h View 1 2 1 chunk +106 lines, -0 lines 0 comments Download
A services/resource_coordinator/coordination_unit/mock_coordination_unit_graphs.cc View 1 2 1 chunk +79 lines, -0 lines 0 comments Download
M services/resource_coordinator/coordination_unit/process_coordination_unit_impl.h View 1 2 2 chunks +1 line, -9 lines 0 comments Download
M services/resource_coordinator/coordination_unit/process_coordination_unit_impl.cc View 1 2 2 chunks +9 lines, -58 lines 0 comments Download
D services/resource_coordinator/coordination_unit/process_coordination_unit_impl_unittest.cc View 1 2 1 chunk +0 lines, -38 lines 0 comments Download
A services/resource_coordinator/coordination_unit/web_contents_coordination_unit_impl_unittest.cc View 1 2 1 chunk +74 lines, -0 lines 0 comments Download
M services/resource_coordinator/public/cpp/resource_coordinator_interface.h View 1 2 2 chunks +6 lines, -0 lines 0 comments Download
M services/resource_coordinator/public/cpp/resource_coordinator_interface.cc View 1 1 chunk +20 lines, -0 lines 0 comments Download
M services/resource_coordinator/public/interfaces/coordination_unit.mojom View 1 chunk +4 lines, -0 lines 0 comments Download

Messages

Total messages: 17 (12 generated)
matthalp
PTAL when convenient -- not urgent. https://codereview.chromium.org/2964103002/diff/40001/chrome/browser/chrome_browser_main.cc File chrome/browser/chrome_browser_main.cc (right): https://codereview.chromium.org/2964103002/diff/40001/chrome/browser/chrome_browser_main.cc#newcode1957 chrome/browser/chrome_browser_main.cc:1957: resource_coordinator::ResourceCoordinatorRenderProcessProbe::GetInstance() TODO(matthalp): Guard ...
3 years, 5 months ago (2017-07-01 19:11:39 UTC) #11
Zhen Wang
Peiyong fixed the set-property-and-propagate part in https://crrev.com/2964803002/. I think his CL will likely to commit ...
3 years, 5 months ago (2017-07-05 15:37:51 UTC) #14
lpy
https://codereview.chromium.org/2964103002/diff/60001/chrome/browser/resource_coordinator/resource_coordinator_render_process_probe.cc File chrome/browser/resource_coordinator/resource_coordinator_render_process_probe.cc (right): https://codereview.chromium.org/2964103002/diff/60001/chrome/browser/resource_coordinator/resource_coordinator_render_process_probe.cc#newcode25 chrome/browser/resource_coordinator/resource_coordinator_render_process_probe.cc:25: const int kMeasurementIntervalInSeconds = 5; I would like to ...
3 years, 5 months ago (2017-07-07 17:49:10 UTC) #15
matthalp
On 2017/07/07 at 17:49:10, lpy wrote: > https://codereview.chromium.org/2964103002/diff/60001/chrome/browser/resource_coordinator/resource_coordinator_render_process_probe.cc > File chrome/browser/resource_coordinator/resource_coordinator_render_process_probe.cc (right): > > https://codereview.chromium.org/2964103002/diff/60001/chrome/browser/resource_coordinator/resource_coordinator_render_process_probe.cc#newcode25 ...
3 years, 5 months ago (2017-07-07 18:04:09 UTC) #16
matthalp
3 years, 5 months ago (2017-07-07 18:36:48 UTC) #17
On 2017/07/07 at 18:04:09, matthalp wrote:
> On 2017/07/07 at 17:49:10, lpy wrote:
> >
https://codereview.chromium.org/2964103002/diff/60001/chrome/browser/resource...
> > File
chrome/browser/resource_coordinator/resource_coordinator_render_process_probe.cc
(right):
> > 
> >
https://codereview.chromium.org/2964103002/diff/60001/chrome/browser/resource...
> >
chrome/browser/resource_coordinator/resource_coordinator_render_process_probe.cc:25:
const int kMeasurementIntervalInSeconds = 5;
> > I would like to understand the reason we chose 5 seconds, and how much
overhead it will have if we change it to, say 0.1 second.
> 
> Right now it is five seconds to ensure the overhead is minimal until there is
a use case that requires a faster sampling rate. For a comparison, the UMA code
samples every 2 minutes. Ideally, I would also like it to be 100ms as well but
have not investigated the overheads yet. I can look into this further.
> 
> Measuring process CPU usage is fairly computationally intensive and not just a
simple system lookup. The CPU measurement code has to open and parse a file to
extract the CPU usage information. The code can be found here:
>
https://cs.chromium.org/chromium/src/base/process/process_metrics.h?type=cs&q...

lpy@, some discussion about CPU usage overheads:
https://groups.google.com/a/google.com/d/msg/chat-frontend-eng/wySsyLvPFio/n_...

Powered by Google App Engine
This is Rietveld 408576698