New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 670921 link

Starred by 3 users

Issue metadata

Status: Fixed
Owner:
Closed: Jan 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

CPU Time column for Task Manager

Project Member Reported by stanisc@chromium.org, Dec 3 2016

Issue description

We should consider adding CPU Time column to Task Manager. 
The column should display the total process CPU time since its creation. It
might be useful to help identify tabs that consume more power (where more CPU cycles go over time).

I've attached a snapshot that shows how does this column look in Process Explorer tool.
 
CPU_time.PNG
46.3 KB View Download
Should this be total CPU time, or some kind of average CPU usage per unit time?
Cc: altimin@chromium.org
Owner: chengx@chromium.org
Status: Assigned (was: Untriaged)
To answer comment #1, this should probably be total CPU time since the process started. That data is readily available, at least on Windows. The average CPU time would be harder to implement without continuously sampling all Chrome processes.
Could we just take total CPU time since the process started divided by the process uptime?
We could. This should be the same as average usage of a single CPU core (%).
How would we call this?

The problem with getting average CPU usage is that the demominator (process uptime) may end up being non-trivial to calculate reliably. In particular, I'm not sure how easy it is to track exactly when computers go to sleep and wake up. If this can be determined easily then I agree that average CPU usage is an intrinsically easy to interpret number.
Good point about the suspended state. We could get suspend / resume notification from PowerObserver and subtract time in suspended state.

For example of suspend / resume notifications see PowerObserver class and GpuWatchdogThread OnSuspend/OnResume methods.
Though one problem with suspended time tracking is that that would need to be handled outside the task manager (in a singleton that listens for power observer notification from the moment Chrome launches). So this might complicate the design a bit.
Cc: brucedaw...@chromium.org
Status: Started (was: Assigned)
Project Member

Comment 11 by bugdroid1@chromium.org, Jan 10 2017

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

commit 848410dc4e71fa3ce9727478ab013a8948c4dfc6
Author: chengx <chengx@chromium.org>
Date: Tue Jan 10 02:35:03 2017

Add process start time and CPU time columns to task manager

Both start time and CPU time are obtained using shared_sampler_win.cc.
By default, they won't show up.

BUG= 670921 

Review-Url: https://codereview.chromium.org/2573183002
Cr-Commit-Position: refs/heads/master@{#442449}

[modify] https://crrev.com/848410dc4e71fa3ce9727478ab013a8948c4dfc6/base/i18n/time_formatting.cc
[modify] https://crrev.com/848410dc4e71fa3ce9727478ab013a8948c4dfc6/base/i18n/time_formatting.h
[modify] https://crrev.com/848410dc4e71fa3ce9727478ab013a8948c4dfc6/base/i18n/time_formatting_unittest.cc
[modify] https://crrev.com/848410dc4e71fa3ce9727478ab013a8948c4dfc6/chrome/app/generated_resources.grd
[modify] https://crrev.com/848410dc4e71fa3ce9727478ab013a8948c4dfc6/chrome/browser/task_manager/sampling/shared_sampler.h
[modify] https://crrev.com/848410dc4e71fa3ce9727478ab013a8948c4dfc6/chrome/browser/task_manager/sampling/shared_sampler_posix.cc
[modify] https://crrev.com/848410dc4e71fa3ce9727478ab013a8948c4dfc6/chrome/browser/task_manager/sampling/shared_sampler_unittest_win.cc
[modify] https://crrev.com/848410dc4e71fa3ce9727478ab013a8948c4dfc6/chrome/browser/task_manager/sampling/shared_sampler_win.cc
[modify] https://crrev.com/848410dc4e71fa3ce9727478ab013a8948c4dfc6/chrome/browser/task_manager/sampling/task_group.cc
[modify] https://crrev.com/848410dc4e71fa3ce9727478ab013a8948c4dfc6/chrome/browser/task_manager/sampling/task_group.h
[modify] https://crrev.com/848410dc4e71fa3ce9727478ab013a8948c4dfc6/chrome/browser/task_manager/sampling/task_manager_impl.cc
[modify] https://crrev.com/848410dc4e71fa3ce9727478ab013a8948c4dfc6/chrome/browser/task_manager/sampling/task_manager_impl.h
[modify] https://crrev.com/848410dc4e71fa3ce9727478ab013a8948c4dfc6/chrome/browser/task_manager/task_manager_interface.h
[modify] https://crrev.com/848410dc4e71fa3ce9727478ab013a8948c4dfc6/chrome/browser/task_manager/task_manager_observer.h
[modify] https://crrev.com/848410dc4e71fa3ce9727478ab013a8948c4dfc6/chrome/browser/task_manager/test_task_manager.cc
[modify] https://crrev.com/848410dc4e71fa3ce9727478ab013a8948c4dfc6/chrome/browser/task_manager/test_task_manager.h
[modify] https://crrev.com/848410dc4e71fa3ce9727478ab013a8948c4dfc6/chrome/browser/ui/task_manager/task_manager_columns.cc
[modify] https://crrev.com/848410dc4e71fa3ce9727478ab013a8948c4dfc6/chrome/browser/ui/task_manager/task_manager_table_model.cc

Status: Fixed (was: Started)
This is only implemented for Windows, correct?

Should we leave this open to track implementation for other platforms?
Re: Comment #13

Yes, it is now only implemented for Windows.

Maybe create another bug for other platforms?
Future implementation work for non-Windows platforms is being tracked in issue 679954.

Sign in to add a comment