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

Method checkHistogram

deps/v8/tools/heap-stats/model.js:77–87  ·  view source on GitHub ↗
(type, entry, bucket_sizes, histogram, overallProperty)

Source from the content-addressed store, hash-verified

75 // Check that a lower bound for histogram memory does not exceed the
76 // overall counter.
77 checkHistogram(type, entry, bucket_sizes, histogram, overallProperty) {
78 let sum = 0;
79 for (let i = 1; i < entry[histogram].length; i++) {
80 sum += entry[histogram][i] * bucket_sizes[i - 1];
81 }
82 const overall = entry[overallProperty];
83 if (sum >= overall) {
84 console.error(
85 `${type}: sum('${histogram}') > overall (${sum} > ${overall})`);
86 }
87 }
88
89 sortInstanceTypePeakMemory() {
90 let entries = Object.entries(this.instanceTypePeakMemory);

Callers 1

finalizeDataSetMethod · 0.95

Calls 1

errorMethod · 0.45

Tested by

no test coverage detected