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

Unified Diff: base/process/process_metrics.h

Issue 29873002: PerformanceMonitor: Add a new UMA histograms to track average CPU utilization (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Comment update Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | base/process/process_metrics.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/process/process_metrics.h
diff --git a/base/process/process_metrics.h b/base/process/process_metrics.h
index f6b225fa94fab2603fdcc51ab425e9dadcc90a4e..81fd44517a6665406369871910be75eeff2236cd 100644
--- a/base/process/process_metrics.h
+++ b/base/process/process_metrics.h
@@ -160,14 +160,19 @@ class BASE_EXPORT ProcessMetrics {
// load and fragmentation.
bool CalculateFreeMemory(FreeMBytes* free) const;
- // Returns the CPU usage in percent since the last time this method was
- // called. The first time this method is called it returns 0 and will return
- // the actual CPU info on subsequent calls.
- // On Windows, the CPU usage value is for all CPUs. So if you have 2 CPUs and
- // your process is using all the cycles of 1 CPU and not the other CPU, this
- // method returns 50.
+ // Returns the CPU usage in percent since the last time this method or
+ // GetPlatformIndependentCPUUsage() was called. The first time this method
+ // is called it returns 0 and will return the actual CPU info on subsequent
+ // calls. On Windows, the CPU usage value is for all CPUs. So if you have
+ // 2 CPUs and your process is using all the cycles of 1 CPU and not the other
+ // CPU, this method returns 50.
double GetCPUUsage();
+ // Same as GetCPUUsage(), but will return consistent values on all platforms
+ // (cancelling the Windows exception mentioned above) by returning a value in
+ // the range of 0 to (100 * numCPUCores) everywhere.
+ double GetPlatformIndependentCPUUsage();
+
// Retrieves accounting information for all I/O operations performed by the
// process.
// If IO information is retrieved successfully, the function returns true
« no previous file with comments | « no previous file | base/process/process_metrics.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698