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

Unified Diff: chrome/browser/performance_monitor/process_metrics_history.cc

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: 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 | tools/metrics/histograms/histograms.xml » ('j') | tools/metrics/histograms/histograms.xml » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/performance_monitor/process_metrics_history.cc
diff --git a/chrome/browser/performance_monitor/process_metrics_history.cc b/chrome/browser/performance_monitor/process_metrics_history.cc
index 9ac206fb36151817a4ccbe446fb28fab2d91d2f6..7bf658deda4821fcdeb4fd72e846bb9e3035ab70 100644
--- a/chrome/browser/performance_monitor/process_metrics_history.cc
+++ b/chrome/browser/performance_monitor/process_metrics_history.cc
@@ -74,9 +74,13 @@ void ProcessMetricsHistory::EndOfCycle() {
void ProcessMetricsHistory::RunPerformanceTriggers() {
// As an initial step, we only care about browser processes.
- if (process_type_ != content::PROCESS_TYPE_BROWSER)
+ if (process_type_ != content::PROCESS_TYPE_BROWSER || sample_count_ == 0)
return;
+ UMA_HISTOGRAM_CUSTOM_COUNTS("PerformanceMonitor.AverageCPU.BrowserProcess",
+ accumulated_cpu_usage_ / sample_count_,
+ 0, 1200, 20);
Alexei Svitkine (slow) 2013/10/18 21:39:12 Can you explain why you're using these parameters?
oystein (OOO til 10th of July) 2013/10/21 14:38:45 1200 is the maximum value we'd see on a 12-core no
Alexei Svitkine (slow) 2013/10/21 14:53:46 I'd suggest picking a value that's more future-pro
oystein (OOO til 10th of July) 2013/10/21 15:15:05 Sure, I'll bounce it to 6400 or something.
Alexei Svitkine (slow) 2013/10/21 15:27:31 All right. And you're okay with the exponential bu
+
// If CPU usage has consistently been above our threshold,
// we *may* have an issue.
if (min_cpu_usage_ > kHighCPUUtilizationThreshold)
« no previous file with comments | « no previous file | tools/metrics/histograms/histograms.xml » ('j') | tools/metrics/histograms/histograms.xml » ('J')

Powered by Google App Engine
This is Rietveld 408576698