MCPcopy Create free account
hub / github.com/ReactTooltip/react-tooltip / buildMarkdownReport

Function buildMarkdownReport

benchmarks/run-benchmark.mjs:100–126  ·  view source on GitHub ↗
(result)

Source from the content-addressed store, hash-verified

98}
99
100function buildMarkdownReport(result) {
101 const lines = [
102 '# React Tooltip Scaling Benchmark',
103 '',
104 `- Timestamp: ${result.timestamp}`,
105 `- Duration: ${result.durationMs} ms`,
106 `- Browser: ${result.browser}`,
107 `- Counts: ${result.counts.join(', ')}`,
108 `- Warmups: ${result.warmups}`,
109 `- Repeats: ${result.repeats}`,
110 `- Timeout: ${result.timeoutMs} ms`,
111 `- Cache directory: ${result.cacheDir}`,
112 `- Worker: ${result.workerId ?? 'standalone'}`,
113 `- Label: ${result.runLabel ?? '—'}`,
114 '',
115 '| Count | V5 mount | V6 mount | Mount delta | V5 unmount | V6 unmount | Unmount delta | V5 update | V6 update | Update delta | V5 mount mem | V6 mount mem | V5 issues | V6 issues |',
116 '| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |',
117 ]
118
119 result.summary.forEach((row) => {
120 lines.push(
121 `| ${row.count} | ${formatMs(row.v5.mount.median)} | ${formatMs(row.v6.mount.median)} | ${formatMs(row.mountDeltaMs)} | ${formatMs(row.v5.unmount.median)} | ${formatMs(row.v6.unmount.median)} | ${formatMs(row.unmountDeltaMs)} | ${formatMs(row.v5.update.median)} | ${formatMs(row.v6.update.median)} | ${formatMs(row.updateDeltaMs)} | ${formatBytes(row.v5.mountMemory.median)} | ${formatBytes(row.v6.mountMemory.median)} | ${row.v5.timeoutCount} | ${row.v6.timeoutCount} |`,
122 )
123 })
124
125 return `${lines.join('\n')}\n`
126}
127
128function logProgress(message) {
129 const timestamp = new Date().toLocaleTimeString()

Callers 1

mainFunction · 0.70

Calls 2

formatMsFunction · 0.70
formatBytesFunction · 0.70

Tested by

no test coverage detected