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

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

Issue 2904703002: Add a histogram for total private memory footprint. (Closed)
Patch Set: Update tests to check private memory footprint on Windows. Created 3 years, 6 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 | « no previous file | chrome/browser/metrics/process_memory_metrics_emitter_browsertest.cc » ('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 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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/process_memory_metrics_emitter.h" 5 #include "chrome/browser/metrics/process_memory_metrics_emitter.h"
6 6
7 #include "base/metrics/histogram_macros.h" 7 #include "base/metrics/histogram_macros.h"
8 #include "base/trace_event/memory_dump_request_args.h" 8 #include "base/trace_event/memory_dump_request_args.h"
9 #include "content/public/common/service_manager_connection.h" 9 #include "content/public/common/service_manager_connection.h"
10 #include "content/public/common/service_names.mojom.h" 10 #include "content/public/common/service_names.mojom.h"
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 76
77 void ProcessMemoryMetricsEmitter::ReceivedMemoryDump( 77 void ProcessMemoryMetricsEmitter::ReceivedMemoryDump(
78 uint64_t dump_guid, 78 uint64_t dump_guid,
79 bool success, 79 bool success,
80 memory_instrumentation::mojom::GlobalMemoryDumpPtr ptr) { 80 memory_instrumentation::mojom::GlobalMemoryDumpPtr ptr) {
81 if (!success) 81 if (!success)
82 return; 82 return;
83 if (!ptr) 83 if (!ptr)
84 return; 84 return;
85 85
86 uint32_t private_footprint_total_kb = 0;
86 for (const ProcessMemoryDumpPtr& pmd : ptr->process_dumps) { 87 for (const ProcessMemoryDumpPtr& pmd : ptr->process_dumps) {
88 private_footprint_total_kb += pmd->private_footprint;
87 switch (pmd->process_type) { 89 switch (pmd->process_type) {
88 case memory_instrumentation::mojom::ProcessType::BROWSER: 90 case memory_instrumentation::mojom::ProcessType::BROWSER:
89 EmitBrowserMemoryMetrics(pmd); 91 EmitBrowserMemoryMetrics(pmd);
90 break; 92 break;
91 case memory_instrumentation::mojom::ProcessType::RENDERER: 93 case memory_instrumentation::mojom::ProcessType::RENDERER:
92 EmitRendererMemoryMetrics(pmd); 94 EmitRendererMemoryMetrics(pmd);
93 break; 95 break;
94 case memory_instrumentation::mojom::ProcessType::GPU: 96 case memory_instrumentation::mojom::ProcessType::GPU:
95 EmitGpuMemoryMetrics(pmd); 97 EmitGpuMemoryMetrics(pmd);
96 break; 98 break;
97 case memory_instrumentation::mojom::ProcessType::UTILITY: 99 case memory_instrumentation::mojom::ProcessType::UTILITY:
98 case memory_instrumentation::mojom::ProcessType::PLUGIN: 100 case memory_instrumentation::mojom::ProcessType::PLUGIN:
99 case memory_instrumentation::mojom::ProcessType::OTHER: 101 case memory_instrumentation::mojom::ProcessType::OTHER:
100 break; 102 break;
101 } 103 }
102 } 104 }
105 UMA_HISTOGRAM_MEMORY_LARGE_MB(
106 "Memory.Experimental.Total2.PrivateMemoryFootprint",
107 private_footprint_total_kb / 1024);
103 } 108 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/metrics/process_memory_metrics_emitter_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698