Display %age-of-core, not %age-of-total, CPU usage in Task Manager |
|||||
Issue descriptionChrome Version: 61.0.3153.0 OS: Windows Under Windows we show each process' CPU usage as a %age of the total available CPU this matches Windows' Task Manager behaviour), whereas on other platforms we show the %age of a core that the process is using. This is annoying because: 1. It makes it hard to spot when a process is saturating a core. - On other platforms, the process would show 100% (or more!) CPU usage. - To know the equivalent %age on Windows, you need to know the # of cores. - Big desktops can have ~50 cores, which means ~2% CPU usage corresponds to a saturated core! 2. It makes it hard to compare CPU usage across platforms. (I believe we have a similar inconsistency with the Memory column, which shows the *resident* pages the process owns, rather than its total committed footprint; if we think the resident footprint is interesting to show, we could add a separate Working Set column)
,
Aug 4 2017
,
Aug 28 2017
,
Sep 11 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/4ae8f2924c42601192fff8e6b887c3c76a6d0483 commit 4ae8f2924c42601192fff8e6b887c3c76a6d0483 Author: Wez <wez@chromium.org> Date: Mon Sep 11 20:52:03 2017 Remove platform-dependent ProcessMetrics::GetCPUUsage() API. GetCPUUsage() returned different measures of CPU usage on Windows to that used on other platforms. This required us to also have a GetPlatformIndependentCPUUsage() API for call-sites that cared about consistent metrics across platforms, such that only TaskManager used the inconsistent API. This CL makes the following changes: - Update the TaskManager to use GetPlatformIndependentCPUUsage(). - Rename TaskManager::GetCPUUsage to GetPlatformIndependentCPUUsage. (Plus similar renaming for TaskGroups's CPU usage members.) - Change the chrome.processes' API implementation of Process.cpu to report percentage-of-one-core usage rather than percentage-of-total. This was already the behaviour on non-Windows platforms, and was apparently the expectation of callers, in spite of the existing documentation stating otherwise. - Update the documentation on the Process.cpu to make the meaning of the returned value more explicit. Bug: 741202 Change-Id: I313b56399df4f26cf995131793799e532e481942 Reviewed-on: https://chromium-review.googlesource.com/598750 Commit-Queue: Wez <wez@chromium.org> Reviewed-by: Ahmed Fakhry <afakhry@chromium.org> Reviewed-by: Nick Carter <nick@chromium.org> Reviewed-by: Charlie Reis (slow) <creis@chromium.org> Reviewed-by: Devlin <rdevlin.cronin@chromium.org> Reviewed-by: Daniel Cheng <dcheng@chromium.org> Cr-Commit-Position: refs/heads/master@{#501033} [modify] https://crrev.com/4ae8f2924c42601192fff8e6b887c3c76a6d0483/base/process/process_metrics.cc [modify] https://crrev.com/4ae8f2924c42601192fff8e6b887c3c76a6d0483/base/process/process_metrics.h [modify] https://crrev.com/4ae8f2924c42601192fff8e6b887c3c76a6d0483/base/process/process_metrics_freebsd.cc [modify] https://crrev.com/4ae8f2924c42601192fff8e6b887c3c76a6d0483/base/process/process_metrics_fuchsia.cc [modify] https://crrev.com/4ae8f2924c42601192fff8e6b887c3c76a6d0483/base/process/process_metrics_ios.cc [modify] https://crrev.com/4ae8f2924c42601192fff8e6b887c3c76a6d0483/base/process/process_metrics_linux.cc [modify] https://crrev.com/4ae8f2924c42601192fff8e6b887c3c76a6d0483/base/process/process_metrics_mac.cc [modify] https://crrev.com/4ae8f2924c42601192fff8e6b887c3c76a6d0483/base/process/process_metrics_openbsd.cc [modify] https://crrev.com/4ae8f2924c42601192fff8e6b887c3c76a6d0483/base/process/process_metrics_unittest.cc [modify] https://crrev.com/4ae8f2924c42601192fff8e6b887c3c76a6d0483/base/process/process_metrics_win.cc [modify] https://crrev.com/4ae8f2924c42601192fff8e6b887c3c76a6d0483/chrome/browser/chromeos/resource_reporter/resource_reporter.cc [modify] https://crrev.com/4ae8f2924c42601192fff8e6b887c3c76a6d0483/chrome/browser/chromeos/resource_reporter/resource_reporter_unittest.cc [modify] https://crrev.com/4ae8f2924c42601192fff8e6b887c3c76a6d0483/chrome/browser/extensions/api/processes/processes_api.cc [modify] https://crrev.com/4ae8f2924c42601192fff8e6b887c3c76a6d0483/chrome/browser/task_manager/sampling/task_group.cc [modify] https://crrev.com/4ae8f2924c42601192fff8e6b887c3c76a6d0483/chrome/browser/task_manager/sampling/task_group.h [modify] https://crrev.com/4ae8f2924c42601192fff8e6b887c3c76a6d0483/chrome/browser/task_manager/sampling/task_group_sampler.cc [modify] https://crrev.com/4ae8f2924c42601192fff8e6b887c3c76a6d0483/chrome/browser/task_manager/sampling/task_manager_impl.cc [modify] https://crrev.com/4ae8f2924c42601192fff8e6b887c3c76a6d0483/chrome/browser/task_manager/sampling/task_manager_impl.h [modify] https://crrev.com/4ae8f2924c42601192fff8e6b887c3c76a6d0483/chrome/browser/task_manager/task_manager_interface.h [modify] https://crrev.com/4ae8f2924c42601192fff8e6b887c3c76a6d0483/chrome/browser/task_manager/test_task_manager.cc [modify] https://crrev.com/4ae8f2924c42601192fff8e6b887c3c76a6d0483/chrome/browser/task_manager/test_task_manager.h [modify] https://crrev.com/4ae8f2924c42601192fff8e6b887c3c76a6d0483/chrome/browser/ui/task_manager/task_manager_table_model.cc [modify] https://crrev.com/4ae8f2924c42601192fff8e6b887c3c76a6d0483/chrome/common/extensions/api/processes.idl
,
Sep 15 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/0a41b75286caf83656ae4c065fc9b9246247a6f7 commit 0a41b75286caf83656ae4c065fc9b9246247a6f7 Author: Wez <wez@chromium.org> Date: Fri Sep 15 02:06:34 2017 Restore ProcessMetrics::GetPlatformIndependentCPUUsage to percentage. While iterating on the CL to remove GetCPUUsage() and replace callers with the platform-independent version, it was broken to return CPU usage as a multiple-of-one-core, rather than percent-of-one-core. This restores the value to the percent-based range. Bug: 741202 Change-Id: I4866f2748dbdab800421561d8fc849d88c73280f Reviewed-on: https://chromium-review.googlesource.com/668098 Commit-Queue: Wez <wez@chromium.org> Commit-Queue: Daniel Cheng <dcheng@chromium.org> Reviewed-by: Daniel Cheng <dcheng@chromium.org> Cr-Commit-Position: refs/heads/master@{#502130} [modify] https://crrev.com/0a41b75286caf83656ae4c065fc9b9246247a6f7/base/process/process_metrics_win.cc
,
Sep 15 2017
Issue 117866 has been merged into this issue.
,
Sep 15 2017
,
Sep 15 2017
I'm not seeing any sign of this change in canary. I just ran Sun Spider on my canary build (which I have confirmed was built today) and CPU usage peaked at about 1.6%. I would have expected something in the 40-100% range. This is on a 48-way machine where ~2% used to represent a fully loaded core, and it seems to still do that.
,
Sep 15 2017
Re #8: Sadly when the CL in #4 landed it change things to report number-of-cores used per-process, rather than percentage-of-core used, i.e. for a single-threaded process the range is 0..1.0 rather than 0..100. On your lovely 48-core beast of a machine you'd be forgiven for thinking nothing changed since this would appear as a ~2x reduction in reported CPU usage relative to the percentage-of-total number. :P Tonight's Canary should have the correct range; apologies for the confusion. |
|||||
►
Sign in to add a comment |
|||||
Comment 1 by brucedaw...@chromium.org
, Jul 12 2017