report each repo's peak worker heap in the status
Signed-off-by: dawn <90008@klbr.net>
149 unmodified linesExpand all15015115215315415515615715815916016178 unmodified lines240241242243244245246247248335 unmodified linesExpand all58458558658758858959059159237 unmodified lines149 unmodified linesExpand allconst accepted = (page, did) => page.status === 200 && page.reads.every((r) => r.status === 200 || !r.key.startsWith("org.tangled.git.") || REPO_PARAM.exec(r.key)?.[1] !== did);
// the repo's peak heap, reported with its stats, shows how near a worker runs to its caplet heapPeak = 0;setInterval(() => (heapPeak = Math.max(heapPeak, process.memoryUsage().heapUsed)), 50).unref();
const pool = async (items, fn) => { const queue = [...items]; await Promise.all( Array.from({ length: JOBS }, async () => {78 unmodified lines
const renderRepo = async (repo, work, budget) => { reads.count = 0; reads.ms = 0; heapPeak = 0; sizes.clear(); files.clear(); readCache.clear(); readCacheChars = 0;335 unmodified linesExpand all reads: reads.count, read_ms: Math.round(reads.ms), ...stats, render_ms: Math.round(stats.render_ms), heap_peak_mb: Math.round(heapPeak / 1_048_576), rss_mb: Math.round(process.memoryUsage().rss / 1_048_576) };};
37 unmodified lines