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

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: Expanded docs 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);
+
// 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