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

Side by Side Diff: chrome/browser/metrics/metrics_memory_details.cc

Issue 1270193002: Add new memory histograms which fix inprecise bucketing. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix the units of the new metrics Created 5 years, 4 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
« no previous file with comments | « base/metrics/histogram_macros.h ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/metrics/metrics_memory_details.h" 5 #include "chrome/browser/metrics/metrics_memory_details.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/location.h" 9 #include "base/location.h"
10 #include "base/metrics/histogram_macros.h" 10 #include "base/metrics/histogram_macros.h"
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 UMA_HISTOGRAM_COUNTS_100("Memory.PluginProcessCount", plugin_count); 188 UMA_HISTOGRAM_COUNTS_100("Memory.PluginProcessCount", plugin_count);
189 UMA_HISTOGRAM_COUNTS_100("Memory.PepperPluginProcessCount", 189 UMA_HISTOGRAM_COUNTS_100("Memory.PepperPluginProcessCount",
190 pepper_plugin_count); 190 pepper_plugin_count);
191 UMA_HISTOGRAM_COUNTS_100("Memory.PepperPluginBrokerProcessCount", 191 UMA_HISTOGRAM_COUNTS_100("Memory.PepperPluginBrokerProcessCount",
192 pepper_plugin_broker_count); 192 pepper_plugin_broker_count);
193 UMA_HISTOGRAM_COUNTS_100("Memory.RendererProcessCount", renderer_count); 193 UMA_HISTOGRAM_COUNTS_100("Memory.RendererProcessCount", renderer_count);
194 UMA_HISTOGRAM_COUNTS_100("Memory.WorkerProcessCount", worker_count); 194 UMA_HISTOGRAM_COUNTS_100("Memory.WorkerProcessCount", worker_count);
195 // TODO(viettrungluu): Do we want separate counts for the other 195 // TODO(viettrungluu): Do we want separate counts for the other
196 // (platform-specific) process types? 196 // (platform-specific) process types?
197 197
198 int total_sample = static_cast<int>(aggregate_memory / 1000); 198 // TODO(rkaplow): Remove once we've verified Memory.Total2 is ok.
199 UMA_HISTOGRAM_MEMORY_MB("Memory.Total", total_sample); 199 int total_sample_old = static_cast<int>(aggregate_memory / 1000);
200 UMA_HISTOGRAM_MEMORY_MB("Memory.Total", total_sample_old);
201 int total_sample = static_cast<int>(aggregate_memory / 1024);
202 UMA_HISTOGRAM_MEMORY_LARGE_MB("Memory.Total2", total_sample);
200 203
201 #if defined(OS_CHROMEOS) 204 #if defined(OS_CHROMEOS)
202 UpdateSwapHistograms(); 205 UpdateSwapHistograms();
203 #endif 206 #endif
204 } 207 }
205 208
206 #if defined(OS_CHROMEOS) 209 #if defined(OS_CHROMEOS)
207 void MetricsMemoryDetails::UpdateSwapHistograms() { 210 void MetricsMemoryDetails::UpdateSwapHistograms() {
208 UMA_HISTOGRAM_BOOLEAN("Memory.Swap.HaveSwapped", swap_info().num_writes > 0); 211 UMA_HISTOGRAM_BOOLEAN("Memory.Swap.HaveSwapped", swap_info().num_writes > 0);
209 if (swap_info().num_writes == 0) 212 if (swap_info().num_writes == 0)
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
265 continue; 268 continue;
266 case PROCESS_TYPE_NACL_BROKER: 269 case PROCESS_TYPE_NACL_BROKER:
267 UMA_HISTOGRAM_MEMORY_KB("Memory.Swap.NativeClientBroker", sample); 270 UMA_HISTOGRAM_MEMORY_KB("Memory.Swap.NativeClientBroker", sample);
268 continue; 271 continue;
269 default: 272 default:
270 NOTREACHED(); 273 NOTREACHED();
271 continue; 274 continue;
272 } 275 }
273 } 276 }
274 277
275 int total_sample = static_cast<int>(aggregate_memory / 1000); 278 // TODO(rkaplow): Remove once we've verified Memory.Swap.Total2 is ok.
276 UMA_HISTOGRAM_MEMORY_MB("Memory.Swap.Total", total_sample); 279 int total_sample_old = static_cast<int>(aggregate_memory / 1000);
280 UMA_HISTOGRAM_MEMORY_MB("Memory.Swap.Total", total_sample_old);
281 int total_sample = static_cast<int>(aggregate_memory / 1024);
282 UMA_HISTOGRAM_MEMORY_LARGE_MB("Memory.Swap.Total2", total_sample);
277 283
278 UMA_HISTOGRAM_CUSTOM_COUNTS("Memory.Swap.CompressedDataSize", 284 UMA_HISTOGRAM_CUSTOM_COUNTS("Memory.Swap.CompressedDataSize",
279 swap_info().compr_data_size / (1024 * 1024), 1, 285 swap_info().compr_data_size / (1024 * 1024), 1,
280 4096, 50); 286 4096, 50);
281 UMA_HISTOGRAM_CUSTOM_COUNTS("Memory.Swap.OriginalDataSize", 287 UMA_HISTOGRAM_CUSTOM_COUNTS("Memory.Swap.OriginalDataSize",
282 swap_info().orig_data_size / (1024 * 1024), 1, 288 swap_info().orig_data_size / (1024 * 1024), 1,
283 4096, 50); 289 4096, 50);
284 UMA_HISTOGRAM_CUSTOM_COUNTS("Memory.Swap.MemUsedTotal", 290 UMA_HISTOGRAM_CUSTOM_COUNTS("Memory.Swap.MemUsedTotal",
285 swap_info().mem_used_total / (1024 * 1024), 1, 291 swap_info().mem_used_total / (1024 * 1024), 1,
286 4096, 50); 292 4096, 50);
287 UMA_HISTOGRAM_CUSTOM_COUNTS("Memory.Swap.NumReads", swap_info().num_reads, 1, 293 UMA_HISTOGRAM_CUSTOM_COUNTS("Memory.Swap.NumReads", swap_info().num_reads, 1,
288 100000000, 100); 294 100000000, 100);
289 UMA_HISTOGRAM_CUSTOM_COUNTS("Memory.Swap.NumWrites", swap_info().num_writes, 295 UMA_HISTOGRAM_CUSTOM_COUNTS("Memory.Swap.NumWrites", swap_info().num_writes,
290 1, 100000000, 100); 296 1, 100000000, 100);
291 297
292 if (swap_info().orig_data_size > 0 && swap_info().compr_data_size > 0) { 298 if (swap_info().orig_data_size > 0 && swap_info().compr_data_size > 0) {
293 UMA_HISTOGRAM_CUSTOM_COUNTS( 299 UMA_HISTOGRAM_CUSTOM_COUNTS(
294 "Memory.Swap.CompressionRatio", 300 "Memory.Swap.CompressionRatio",
295 swap_info().orig_data_size / swap_info().compr_data_size, 1, 20, 20); 301 swap_info().orig_data_size / swap_info().compr_data_size, 1, 20, 20);
296 } 302 }
297 } 303 }
298 #endif // defined(OS_CHROMEOS) 304 #endif // defined(OS_CHROMEOS)
OLDNEW
« no previous file with comments | « base/metrics/histogram_macros.h ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698