OLD | NEW |
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/iteration_helpers.html"> | 8 <link rel="import" href="/tracing/base/iteration_helpers.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/range.html"> | 10 <link rel="import" href="/tracing/base/range.html"> |
(...skipping 754 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
765 browserName, levelOfDetailName, levelOfDetailDumpCount, values) { | 765 browserName, levelOfDetailName, levelOfDetailDumpCount, values) { |
766 // Construct the name of the memory value. | 766 // Construct the name of the memory value. |
767 var nameParts = ['memory', browserName, 'all_processes', 'dump_count']; | 767 var nameParts = ['memory', browserName, 'all_processes', 'dump_count']; |
768 if (levelOfDetailName !== undefined) | 768 if (levelOfDetailName !== undefined) |
769 nameParts.push(levelOfDetailName); | 769 nameParts.push(levelOfDetailName); |
770 var name = nameParts.join(':'); | 770 var name = nameParts.join(':'); |
771 | 771 |
772 // Build the underlying histogram for the memory value. | 772 // Build the underlying histogram for the memory value. |
773 var histogram = new tr.v.Histogram(unitlessNumber_smallerIsBetter, | 773 var histogram = new tr.v.Histogram(unitlessNumber_smallerIsBetter, |
774 BOUNDARIES_FOR_UNIT_MAP.get(unitlessNumber_smallerIsBetter)); | 774 BOUNDARIES_FOR_UNIT_MAP.get(unitlessNumber_smallerIsBetter)); |
775 histogram.add(levelOfDetailDumpCount); | 775 histogram.addSample(levelOfDetailDumpCount); |
776 | 776 |
777 // Build the options for the memory value. | 777 // Build the options for the memory value. |
778 var description = [ | 778 var description = [ |
779 'total number of', | 779 'total number of', |
780 levelOfDetailName || 'all', | 780 levelOfDetailName || 'all', |
781 'memory dumps added by', | 781 'memory dumps added by', |
782 convertBrowserNameToUserFriendlyName(browserName), | 782 convertBrowserNameToUserFriendlyName(browserName), |
783 'to the trace' | 783 'to the trace' |
784 ].join(' '); | 784 ].join(' '); |
785 var options = { description: description }; | 785 var options = { description: description }; |
(...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1117 childNode, unit, descriptionPrefixBuilder, values); | 1117 childNode, unit, descriptionPrefixBuilder, values); |
1118 }); | 1118 }); |
1119 componentPath.pop(); | 1119 componentPath.pop(); |
1120 } | 1120 } |
1121 | 1121 |
1122 /** | 1122 /** |
1123 * Create a memory tr.v.Histogram with |unit| and add all total values in | 1123 * Create a memory tr.v.Histogram with |unit| and add all total values in |
1124 * |node| to it. | 1124 * |node| to it. |
1125 */ | 1125 */ |
1126 function buildMemoryNumericFromNode(node, unit) { | 1126 function buildMemoryNumericFromNode(node, unit) { |
1127 var numeric = new tr.v.Histogram(unit, BOUNDARIES_FOR_UNIT_MAP.get(unit)); | 1127 var histogram = new tr.v.Histogram(unit, BOUNDARIES_FOR_UNIT_MAP.get(unit)); |
1128 node.values.forEach(v => numeric.add(v.total)); | 1128 node.values.forEach(v => histogram.addSample(v.total)); |
1129 return numeric; | 1129 return histogram; |
1130 } | 1130 } |
1131 | 1131 |
1132 tr.metrics.MetricRegistry.register(memoryMetric, { | 1132 tr.metrics.MetricRegistry.register(memoryMetric, { |
1133 supportsRangeOfInterest: true | 1133 supportsRangeOfInterest: true |
1134 }); | 1134 }); |
1135 | 1135 |
1136 return { | 1136 return { |
1137 memoryMetric: memoryMetric | 1137 memoryMetric: memoryMetric |
1138 }; | 1138 }; |
1139 }); | 1139 }); |
1140 </script> | 1140 </script> |
OLD | NEW |