Chromium Code Reviews| Index: tracing/tracing/metrics/system_health/memory_metric.html |
| diff --git a/tracing/tracing/metrics/system_health/memory_metric.html b/tracing/tracing/metrics/system_health/memory_metric.html |
| index acccd77c6b37cc50f1abfaf9c04ecf8bf258752d..226057d3ae3c44e79951249c508eea8023082732 100644 |
| --- a/tracing/tracing/metrics/system_health/memory_metric.html |
| +++ b/tracing/tracing/metrics/system_health/memory_metric.html |
| @@ -275,15 +275,20 @@ tr.exportTo('tr.metrics.sh', function() { |
| var v8Dump = processDump.getMemoryAllocatorDumpByFullName('v8'); |
| if (v8Dump !== undefined) { |
| var allocatedByMalloc = 0; |
| + var peakAllocatedByMalloc = 0; |
| var hasMallocDump = false; |
| v8Dump.children.forEach(function(isolateDump) { |
| var mallocDump = |
| isolateDump.getDescendantDumpByFullName('malloc'); |
| - if (mallocDump === undefined || |
| - mallocDump.numerics['effective_size'] === undefined) { |
| + if (mallocDump === undefined) |
| return; |
| + if (mallocDump.numerics['effective_size'] !== undefined) { |
| + allocatedByMalloc += |
| + mallocDump.numerics['effective_size'].value; |
| + } |
| + if (mallocDump.numerics['peak_size'] !== undefined) { |
|
petrcermak
2016/07/21 13:11:48
nit: no need for braces here
ulan
2016/07/21 13:47:06
Done.
|
| + peakAllocatedByMalloc += mallocDump.numerics['peak_size'].value; |
| } |
| - allocatedByMalloc += mallocDump.numerics['effective_size'].value; |
| hasMallocDump = true; |
| }); |
| if (hasMallocDump) { |
| @@ -296,6 +301,15 @@ tr.exportTo('tr.metrics.sh', function() { |
| descriptionPrefixBuilder: |
| CHROME_VALUE_PROPERTIES['effective_size'] |
| }); |
| + addProcessScalar({ |
| + source: 'reported_by_chrome', |
| + component: ['v8', 'allocated_by_malloc'], |
| + property: 'peak_size', |
| + value: peakAllocatedByMalloc, |
| + unit: sizeInBytes_smallerIsBetter, |
| + descriptionPrefixBuilder: |
| + CHROME_VALUE_PROPERTIES['peak_size'] |
| + }); |
| } |
| } |
| }, |
| @@ -403,7 +417,11 @@ tr.exportTo('tr.metrics.sh', function() { |
| 'locked_size': buildChromeValueDescriptionPrefix.bind(undefined, { |
| userFriendlyPropertyName: 'locked (pinned) size', |
| componentPreposition: 'of' |
| - }) |
| + }), |
| + 'peak_size': buildChromeValueDescriptionPrefix.bind(undefined, { |
| + userFriendlyPropertyName: 'peak size', |
| + componentPreposition: 'of' |
| + }), |
| }; |
| /** |