MCPcopy Create free account
hub / github.com/avoidwork/tenso / report

Method report

benchmarks/memory.js:73–92  ·  view source on GitHub ↗

* Prints memory usage report

()

Source from the content-addressed store, hash-verified

71 * Prints memory usage report
72 */
73 report () {
74 console.log("\n📊 Memory Usage Report");
75 console.log("-".repeat(50));
76
77 this.snapshots.forEach((snapshot, index) => {
78 console.log(`${index + 1}. ${snapshot.label}:`);
79 console.log(` RSS: ${this.formatBytes(snapshot.rss)}`);
80 console.log(` Heap Used: ${this.formatBytes(snapshot.heapUsed)}`);
81 console.log(` Heap Total: ${this.formatBytes(snapshot.heapTotal)}`);
82 console.log(` External: ${this.formatBytes(snapshot.external)}`);
83
84 if (index > 0) {
85 const diff = this.diff(index - 1, index);
86 console.log(" Change from previous:");
87 console.log(` RSS: ${this.formatBytes(diff.rss)}`);
88 console.log(` Heap Used: ${this.formatBytes(diff.heapUsed)}`);
89 }
90 console.log("");
91 });
92 }
93
94 /**
95 * Clears all snapshots

Callers 8

testServerLifecycleFunction · 0.95
testRequestProcessingFunction · 0.95
testParserMemoryFunction · 0.95
testRendererMemoryFunction · 0.95
testRateLimitMemoryFunction · 0.95
testMemoryLeaksFunction · 0.95
testHypermediaMemoryFunction · 0.95
testMemoryPressureFunction · 0.95

Calls 3

formatBytesMethod · 0.95
diffMethod · 0.95
logMethod · 0.80

Tested by

no test coverage detected