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

Side by Side Diff: chrome/browser/performance_monitor/process_metrics_history.cc

Issue 2694363007: Add memory and CPU histogram for OOPIF
Patch Set: Created 3 years, 10 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
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 "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_macros.h" 10 #include "base/metrics/histogram_macros.h"
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 // we *may* have an issue. 100 // we *may* have an issue.
101 if (cpu_usage_ > kHighCPUUtilizationThreshold) { 101 if (cpu_usage_ > kHighCPUUtilizationThreshold) {
102 UMA_HISTOGRAM_BOOLEAN("PerformanceMonitor.HighCPU.BrowserProcess", 102 UMA_HISTOGRAM_BOOLEAN("PerformanceMonitor.HighCPU.BrowserProcess",
103 true); 103 true);
104 } 104 }
105 break; 105 break;
106 case content::PROCESS_TYPE_RENDERER: 106 case content::PROCESS_TYPE_RENDERER:
107 UMA_HISTOGRAM_CUSTOM_COUNTS( 107 UMA_HISTOGRAM_CUSTOM_COUNTS(
108 "PerformanceMonitor.AverageCPU.RendererProcess", cpu_usage_, 108 "PerformanceMonitor.AverageCPU.RendererProcess", cpu_usage_,
109 kHistogramMin, kHistogramMax, kHistogramBucketCount); 109 kHistogramMin, kHistogramMax, kHistogramBucketCount);
110 if (process_data_.contains_oopif) {
111 UMA_HISTOGRAM_CUSTOM_COUNTS("SiteIsolation.Oopif.AverageCPU",
112 cpu_usage_, kHistogramMin, kHistogramMax,
113 kHistogramBucketCount);
114 }
110 if (cpu_usage_ > kHighCPUUtilizationThreshold) { 115 if (cpu_usage_ > kHighCPUUtilizationThreshold) {
111 UMA_HISTOGRAM_BOOLEAN("PerformanceMonitor.HighCPU.RendererProcess", 116 UMA_HISTOGRAM_BOOLEAN("PerformanceMonitor.HighCPU.RendererProcess",
112 true); 117 true);
118 if (process_data_.contains_oopif) {
119 UMA_HISTOGRAM_BOOLEAN("SiteIsolation.Oopif.HighCPU", true);
120 }
113 } 121 }
114 break; 122 break;
115 case content::PROCESS_TYPE_GPU: 123 case content::PROCESS_TYPE_GPU:
116 UMA_HISTOGRAM_CUSTOM_COUNTS("PerformanceMonitor.AverageCPU.GPUProcess", 124 UMA_HISTOGRAM_CUSTOM_COUNTS("PerformanceMonitor.AverageCPU.GPUProcess",
117 cpu_usage_, kHistogramMin, kHistogramMax, 125 cpu_usage_, kHistogramMin, kHistogramMax,
118 kHistogramBucketCount); 126 kHistogramBucketCount);
119 if (cpu_usage_ > kHighCPUUtilizationThreshold) 127 if (cpu_usage_ > kHighCPUUtilizationThreshold)
120 UMA_HISTOGRAM_BOOLEAN("PerformanceMonitor.HighCPU.GPUProcess", true); 128 UMA_HISTOGRAM_BOOLEAN("PerformanceMonitor.HighCPU.GPUProcess", true);
121 break; 129 break;
122 case content::PROCESS_TYPE_PPAPI_PLUGIN: 130 case content::PROCESS_TYPE_PPAPI_PLUGIN:
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 173
166 if (cpu_usage_ > kHighCPUUtilizationThreshold && 174 if (cpu_usage_ > kHighCPUUtilizationThreshold &&
167 trace_trigger_handle_ != -1) { 175 trace_trigger_handle_ != -1) {
168 content::BackgroundTracingManager::GetInstance()->TriggerNamedEvent( 176 content::BackgroundTracingManager::GetInstance()->TriggerNamedEvent(
169 trace_trigger_handle_, 177 trace_trigger_handle_,
170 content::BackgroundTracingManager::StartedFinalizingCallback()); 178 content::BackgroundTracingManager::StartedFinalizingCallback());
171 } 179 }
172 } 180 }
173 181
174 } // namespace performance_monitor 182 } // namespace performance_monitor
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698