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

Side by Side Diff: tracing/tracing/metrics/system_health/memory_metric.html

Issue 3012213002: tracing: Add private footprint (Closed)
Patch Set: Created 3 years, 3 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 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <!-- 2 <!--
3 Copyright 2016 The Chromium Authors. All rights reserved. 3 Copyright 2016 The Chromium Authors. All rights reserved.
4 Use of this source code is governed by a BSD-style license that can be 4 Use of this source code is governed by a BSD-style license that can be
5 found in the LICENSE file. 5 found in the LICENSE file.
6 --> 6 -->
7 7
8 <link rel="import" href="/tracing/base/math/range.html"> 8 <link rel="import" href="/tracing/base/math/range.html">
9 <link rel="import" href="/tracing/base/multi_dimensional_view.html"> 9 <link rel="import" href="/tracing/base/multi_dimensional_view.html">
10 <link rel="import" href="/tracing/base/unit.html"> 10 <link rel="import" href="/tracing/base/unit.html">
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after
250 property: RESIDENT_SIZE, 250 property: RESIDENT_SIZE,
251 component: ['system_memory'], 251 component: ['system_memory'],
252 value: processDump.totals.residentBytes 252 value: processDump.totals.residentBytes
253 }); 253 });
254 addProcessScalar({ 254 addProcessScalar({
255 source: 'reported_by_os', 255 source: 'reported_by_os',
256 property: PEAK_RESIDENT_SIZE, 256 property: PEAK_RESIDENT_SIZE,
257 component: ['system_memory'], 257 component: ['system_memory'],
258 value: processDump.totals.peakResidentBytes 258 value: processDump.totals.peakResidentBytes
259 }); 259 });
260 addProcessScalar({
261 source: 'reported_by_os',
262 property: PRIVATE_FOOTPRINT_SIZE,
263 component: ['system_memory'],
264 value: processDump.totals.privateFootprintBytes,
265 });
260 } 266 }
261 267
262 // Add memory:<browser-name>:<process-name>:reported_by_chrome:... 268 // Add memory:<browser-name>:<process-name>:reported_by_chrome:...
263 // values. 269 // values.
264 if (processDump.memoryAllocatorDumps === undefined) return; 270 if (processDump.memoryAllocatorDumps === undefined) return;
265 271
266 processDump.memoryAllocatorDumps.forEach(function(rootAllocatorDump) { 272 processDump.memoryAllocatorDumps.forEach(function(rootAllocatorDump) {
267 CHROME_VALUE_PROPERTIES.forEach(function(property) { 273 CHROME_VALUE_PROPERTIES.forEach(function(property) {
268 addProcessScalar({ 274 addProcessScalar({
269 source: 'reported_by_chrome', 275 source: 'reported_by_chrome',
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after
553 559
554 const PRIVATE_DIRTY_SIZE = { 560 const PRIVATE_DIRTY_SIZE = {
555 name: 'private_dirty_size', 561 name: 'private_dirty_size',
556 unit: sizeInBytes_smallerIsBetter, 562 unit: sizeInBytes_smallerIsBetter,
557 buildDescriptionPrefix(componentPath, processName) { 563 buildDescriptionPrefix(componentPath, processName) {
558 return buildOsValueDescriptionPrefix(componentPath, processName, 564 return buildOsValueDescriptionPrefix(componentPath, processName,
559 'private dirty size'); 565 'private dirty size');
560 } 566 }
561 }; 567 };
562 568
569 const PRIVATE_FOOTPRINT_SIZE = {
570 name: 'private_footprint_size',
571 unit: sizeInBytes_smallerIsBetter,
572 buildDescriptionPrefix(componentPath, processName) {
573 return buildOsValueDescriptionPrefix(componentPath, processName,
574 'private footprint size');
575 }
576 };
577
563 /** 578 /**
564 * Build a description prefix for a memory:<browser-name>:<process-name>: 579 * Build a description prefix for a memory:<browser-name>:<process-name>:
565 * reported_by_os:... value. 580 * reported_by_os:... value.
566 * 581 *
567 * @param {!Array<string>} componentPath The underlying component path (e.g. 582 * @param {!Array<string>} componentPath The underlying component path (e.g.
568 * ['system', 'java_heap']). 583 * ['system', 'java_heap']).
569 * @param {string} processName The canonical name of the process. 584 * @param {string} processName The canonical name of the process.
570 * @param {string} userFriendlyPropertyName User-friendly name of the 585 * @param {string} userFriendlyPropertyName User-friendly name of the
571 * underlying property (e.g. 'private dirty size'). 586 * underlying property (e.g. 'private dirty size').
572 * @return {string} Prefix for the value's description (e.g. 587 * @return {string} Prefix for the value's description (e.g.
(...skipping 638 matching lines...) Expand 10 before | Expand all | Expand 10 after
1211 1226
1212 tr.metrics.MetricRegistry.register(memoryMetric, { 1227 tr.metrics.MetricRegistry.register(memoryMetric, {
1213 supportsRangeOfInterest: true 1228 supportsRangeOfInterest: true
1214 }); 1229 });
1215 1230
1216 return { 1231 return {
1217 memoryMetric, 1232 memoryMetric,
1218 }; 1233 };
1219 }); 1234 });
1220 </script> 1235 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698