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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <limits> 5 #include <limits>
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/metrics/histogram.h" 8 #include "base/metrics/histogram.h"
9 #include "base/process/process_metrics.h" 9 #include "base/process/process_metrics.h"
10 10
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 sample_count_++; 67 sample_count_++;
68 } 68 }
69 69
70 void ProcessMetricsHistory::EndOfCycle() { 70 void ProcessMetricsHistory::EndOfCycle() {
71 RunPerformanceTriggers(); 71 RunPerformanceTriggers();
72 ResetCounters(); 72 ResetCounters();
73 } 73 }
74 74
75 void ProcessMetricsHistory::RunPerformanceTriggers() { 75 void ProcessMetricsHistory::RunPerformanceTriggers() {
76 // As an initial step, we only care about browser processes. 76 // As an initial step, we only care about browser processes.
77 if (process_type_ != content::PROCESS_TYPE_BROWSER) 77 if (process_type_ != content::PROCESS_TYPE_BROWSER || sample_count_ == 0)
78 return; 78 return;
79 79
80 UMA_HISTOGRAM_CUSTOM_COUNTS("PerformanceMonitor.AverageCPU.BrowserProcess",
81 accumulated_cpu_usage_ / sample_count_,
82 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
83
80 // If CPU usage has consistently been above our threshold, 84 // If CPU usage has consistently been above our threshold,
81 // we *may* have an issue. 85 // we *may* have an issue.
82 if (min_cpu_usage_ > kHighCPUUtilizationThreshold) 86 if (min_cpu_usage_ > kHighCPUUtilizationThreshold)
83 UMA_HISTOGRAM_BOOLEAN("PerformanceMonitor.HighCPU.BrowserProcess", true); 87 UMA_HISTOGRAM_BOOLEAN("PerformanceMonitor.HighCPU.BrowserProcess", true);
84 } 88 }
85 89
86 } // namespace performance_monitor 90 } // namespace performance_monitor
OLDNEW
« 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