OLD | NEW |
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 "chrome/browser/performance_monitor/process_metrics_history.h" | 5 #include "chrome/browser/performance_monitor/process_metrics_history.h" |
6 | 6 |
7 #include <limits> | 7 #include <limits> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 break; | 108 break; |
109 case content::PROCESS_TYPE_RENDERER: | 109 case content::PROCESS_TYPE_RENDERER: |
110 UMA_HISTOGRAM_CUSTOM_COUNTS( | 110 UMA_HISTOGRAM_CUSTOM_COUNTS( |
111 "PerformanceMonitor.AverageCPU.RendererProcess", cpu_usage_, | 111 "PerformanceMonitor.AverageCPU.RendererProcess", cpu_usage_, |
112 kHistogramMin, kHistogramMax, kHistogramBucketCount); | 112 kHistogramMin, kHistogramMax, kHistogramBucketCount); |
113 if (cpu_usage_ > kHighCPUUtilizationThreshold) { | 113 if (cpu_usage_ > kHighCPUUtilizationThreshold) { |
114 UMA_HISTOGRAM_BOOLEAN("PerformanceMonitor.HighCPU.RendererProcess", | 114 UMA_HISTOGRAM_BOOLEAN("PerformanceMonitor.HighCPU.RendererProcess", |
115 true); | 115 true); |
116 } | 116 } |
117 break; | 117 break; |
118 case content::PROCESS_TYPE_PLUGIN: | |
119 UMA_HISTOGRAM_CUSTOM_COUNTS("PerformanceMonitor.AverageCPU.PluginProcess", | |
120 cpu_usage_, kHistogramMin, kHistogramMax, | |
121 kHistogramBucketCount); | |
122 if (cpu_usage_ > kHighCPUUtilizationThreshold) | |
123 UMA_HISTOGRAM_BOOLEAN("PerformanceMonitor.HighCPU.PluginProcess", true); | |
124 break; | |
125 case content::PROCESS_TYPE_GPU: | 118 case content::PROCESS_TYPE_GPU: |
126 UMA_HISTOGRAM_CUSTOM_COUNTS("PerformanceMonitor.AverageCPU.GPUProcess", | 119 UMA_HISTOGRAM_CUSTOM_COUNTS("PerformanceMonitor.AverageCPU.GPUProcess", |
127 cpu_usage_, kHistogramMin, kHistogramMax, | 120 cpu_usage_, kHistogramMin, kHistogramMax, |
128 kHistogramBucketCount); | 121 kHistogramBucketCount); |
129 if (cpu_usage_ > kHighCPUUtilizationThreshold) | 122 if (cpu_usage_ > kHighCPUUtilizationThreshold) |
130 UMA_HISTOGRAM_BOOLEAN("PerformanceMonitor.HighCPU.GPUProcess", true); | 123 UMA_HISTOGRAM_BOOLEAN("PerformanceMonitor.HighCPU.GPUProcess", true); |
131 break; | 124 break; |
132 case content::PROCESS_TYPE_PPAPI_PLUGIN: | 125 case content::PROCESS_TYPE_PPAPI_PLUGIN: |
133 UMA_HISTOGRAM_CUSTOM_COUNTS("PerformanceMonitor.AverageCPU.PPAPIProcess", | 126 UMA_HISTOGRAM_CUSTOM_COUNTS("PerformanceMonitor.AverageCPU.PPAPIProcess", |
134 cpu_usage_, kHistogramMin, kHistogramMax, | 127 cpu_usage_, kHistogramMin, kHistogramMax, |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 | 168 |
176 if (cpu_usage_ > kHighCPUUtilizationThreshold && | 169 if (cpu_usage_ > kHighCPUUtilizationThreshold && |
177 trace_trigger_handle_ != -1) { | 170 trace_trigger_handle_ != -1) { |
178 content::BackgroundTracingManager::GetInstance()->TriggerNamedEvent( | 171 content::BackgroundTracingManager::GetInstance()->TriggerNamedEvent( |
179 trace_trigger_handle_, | 172 trace_trigger_handle_, |
180 content::BackgroundTracingManager::StartedFinalizingCallback()); | 173 content::BackgroundTracingManager::StartedFinalizingCallback()); |
181 } | 174 } |
182 } | 175 } |
183 | 176 |
184 } // namespace performance_monitor | 177 } // namespace performance_monitor |
OLD | NEW |