MCPcopy Index your code
hub / github.com/nodejs/node / toString

Method toString

deps/v8/tools/parse-processor.mjs:557–574  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

555 }
556
557 toString() {
558 let ticks = " ▁▂▃▄▅▆▇█";
559 let accString = this.accumulator.reduce((str, each) => {
560 let index = Math.round(each / this.max * (ticks.length - 1));
561 return str + ticks[index];
562 }, '');
563 let percent0 = this.accumulator[0]
564 let percent1 = this.accumulator[1];
565 let percent2plus = this.accumulator.slice(2)
566 .reduce((sum, each) => sum + each, 0);
567 return " - fn nesting level: " +
568 ' avg=' + formatNumber(this.avg) +
569 ' l0=' + PERCENT(percent0, this.totalBytes) +
570 ' l1=' + PERCENT(percent1, this.totalBytes) +
571 ' l2+=' + PERCENT(percent2plus, this.totalBytes) +
572 ' nesting-histogram=[' + accString + ']';
573
574 }
575
576 setMetrics(dict) {}
577}

Callers 2

calculateMetricsMethod · 0.95
printMethod · 0.95

Calls 4

PERCENTFunction · 0.85
reduceMethod · 0.80
formatNumberFunction · 0.70
sliceMethod · 0.65

Tested by

no test coverage detected