| OLD | NEW |
| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 int pepper_plugin_broker_count = 0; | 82 int pepper_plugin_broker_count = 0; |
| 83 int renderer_count = 0; | 83 int renderer_count = 0; |
| 84 int other_count = 0; | 84 int other_count = 0; |
| 85 int worker_count = 0; | 85 int worker_count = 0; |
| 86 int process_limit = content::RenderProcessHost::GetMaxRendererProcessCount(); | 86 int process_limit = content::RenderProcessHost::GetMaxRendererProcessCount(); |
| 87 for (size_t index = 0; index < browser.processes.size(); index++) { | 87 for (size_t index = 0; index < browser.processes.size(); index++) { |
| 88 int sample = static_cast<int>(browser.processes[index].working_set.priv); | 88 int sample = static_cast<int>(browser.processes[index].working_set.priv); |
| 89 aggregate_memory += sample; | 89 aggregate_memory += sample; |
| 90 switch (browser.processes[index].process_type) { | 90 switch (browser.processes[index].process_type) { |
| 91 case content::PROCESS_TYPE_BROWSER: | 91 case content::PROCESS_TYPE_BROWSER: |
| 92 UMA_HISTOGRAM_MEMORY_KB("Memory.Browser", sample); | 92 UMA_HISTOGRAM_MEMORY_LARGE_MB("Memory.Browser.Large2", sample / 1024); |
| 93 UMA_HISTOGRAM_MEMORY_LARGE_MB("Memory.Browser.Large", sample); | |
| 94 continue; | 93 continue; |
| 95 case content::PROCESS_TYPE_RENDERER: { | 94 case content::PROCESS_TYPE_RENDERER: { |
| 96 ProcessMemoryInformation::RendererProcessType renderer_type = | 95 ProcessMemoryInformation::RendererProcessType renderer_type = |
| 97 browser.processes[index].renderer_type; | 96 browser.processes[index].renderer_type; |
| 98 switch (renderer_type) { | 97 switch (renderer_type) { |
| 99 case ProcessMemoryInformation::RENDERER_EXTENSION: | 98 case ProcessMemoryInformation::RENDERER_EXTENSION: |
| 100 UMA_HISTOGRAM_MEMORY_KB("Memory.Extension", sample); | 99 UMA_HISTOGRAM_MEMORY_KB("Memory.Extension", sample); |
| 101 extension_count++; | 100 extension_count++; |
| 102 continue; | 101 continue; |
| 103 case ProcessMemoryInformation::RENDERER_CHROME: | 102 case ProcessMemoryInformation::RENDERER_CHROME: |
| 104 UMA_HISTOGRAM_MEMORY_KB("Memory.Chrome", sample); | 103 UMA_HISTOGRAM_MEMORY_KB("Memory.Chrome", sample); |
| 105 chrome_count++; | 104 chrome_count++; |
| 106 continue; | 105 continue; |
| 107 case ProcessMemoryInformation::RENDERER_UNKNOWN: | 106 case ProcessMemoryInformation::RENDERER_UNKNOWN: |
| 108 NOTREACHED() << "Unknown renderer process type."; | 107 NOTREACHED() << "Unknown renderer process type."; |
| 109 continue; | 108 continue; |
| 110 case ProcessMemoryInformation::RENDERER_NORMAL: | 109 case ProcessMemoryInformation::RENDERER_NORMAL: |
| 111 default: | 110 default: |
| 112 // TODO(erikkay): Should we bother splitting out the other subtypes? | 111 // TODO(erikkay): Should we bother splitting out the other subtypes? |
| 113 UMA_HISTOGRAM_MEMORY_KB("Memory.Renderer", sample); | 112 UMA_HISTOGRAM_MEMORY_LARGE_MB("Memory.Renderer.Large2", |
| 113 sample / 1024); |
| 114 int diff; | 114 int diff; |
| 115 if (memory_growth_tracker_ && | 115 if (memory_growth_tracker_ && |
| 116 memory_growth_tracker_->UpdateSample( | 116 memory_growth_tracker_->UpdateSample( |
| 117 browser.processes[index].pid, sample, &diff)) { | 117 browser.processes[index].pid, sample, &diff)) { |
| 118 if (diff < 0) | 118 if (diff < 0) |
| 119 UMA_HISTOGRAM_MEMORY_KB("Memory.RendererShrinkIn30Min", -diff); | 119 UMA_HISTOGRAM_MEMORY_KB("Memory.RendererShrinkIn30Min", -diff); |
| 120 else | 120 else |
| 121 UMA_HISTOGRAM_MEMORY_KB("Memory.RendererGrowthIn30Min", diff); | 121 UMA_HISTOGRAM_MEMORY_KB("Memory.RendererGrowthIn30Min", diff); |
| 122 } | 122 } |
| 123 renderer_count++; | 123 renderer_count++; |
| (...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 298 UMA_HISTOGRAM_CUSTOM_COUNTS("Memory.Swap.NumWrites", swap_info().num_writes, | 298 UMA_HISTOGRAM_CUSTOM_COUNTS("Memory.Swap.NumWrites", swap_info().num_writes, |
| 299 1, 100000000, 100); | 299 1, 100000000, 100); |
| 300 | 300 |
| 301 if (swap_info().orig_data_size > 0 && swap_info().compr_data_size > 0) { | 301 if (swap_info().orig_data_size > 0 && swap_info().compr_data_size > 0) { |
| 302 UMA_HISTOGRAM_CUSTOM_COUNTS( | 302 UMA_HISTOGRAM_CUSTOM_COUNTS( |
| 303 "Memory.Swap.CompressionRatio", | 303 "Memory.Swap.CompressionRatio", |
| 304 swap_info().orig_data_size / swap_info().compr_data_size, 1, 20, 20); | 304 swap_info().orig_data_size / swap_info().compr_data_size, 1, 20, 20); |
| 305 } | 305 } |
| 306 } | 306 } |
| 307 #endif // defined(OS_CHROMEOS) | 307 #endif // defined(OS_CHROMEOS) |
| OLD | NEW |