MCPcopy Create free account
hub / github.com/nodejs/node / finalizeDataSet

Method finalizeDataSet

deps/v8/tools/heap-stats/model.js:48–73  ·  view source on GitHub ↗
(data_set)

Source from the content-addressed store, hash-verified

46 }
47
48 finalizeDataSet(data_set) {
49 // Create a ranked instance type array that sorts instance types by
50 // memory size (overall).
51 let data = data_set.instance_type_data;
52 let ranked_instance_types =
53 [...data_set.non_empty_instance_types].sort((a, b) => {
54 return data[a].overall - data[b].overall;
55 });
56 // Reassemble the instance_type list sorted by size.
57 let sorted_data = Object.create(null);
58 let max = 0;
59 ranked_instance_types.forEach((name) => {
60 let entry = sorted_data[name] = data[name];
61 max = Math.max(max, entry.overall);
62 });
63 data_set.instance_type_data = data;
64 data_set.singleInstancePeakMemory = max;
65
66 Object.entries(data_set.instance_type_data).forEach(([name, entry]) => {
67 this.checkHistogram(
68 name, entry, data_set.bucket_sizes, 'histogram', ' overall');
69 this.checkHistogram(
70 name, entry, data_set.bucket_sizes, 'over_allocated_histogram',
71 ' over_allocated');
72 });
73 }
74
75 // Check that a lower bound for histogram memory does not exceed the
76 // overall counter.

Callers 1

finalizeGCMethod · 0.95

Calls 6

checkHistogramMethod · 0.95
sortMethod · 0.80
forEachMethod · 0.65
createMethod · 0.45
maxMethod · 0.45
entriesMethod · 0.45

Tested by

no test coverage detected