Add live server performance monitoring

This commit is contained in:
Jonathan Sykes
2026-10-14 02:43:20 +08:00
parent 4884589f36
commit e9a597c415
5 changed files with 159 additions and 3 deletions

View File

@@ -108,5 +108,5 @@ export function createYtdlpPool({ ytdlpPath = '', size = 2, timeoutMs = 60_000,
for (const w of workers) if (!w.busy) retire(w);
}
return { run, close, recycle, get disabled() { return disabled; } };
return { run, close, recycle, stats: () => ({ queued: queue.length, workers: workers.length, busy: workers.filter(w => !!w.busy).length, disabled }), get disabled() { return disabled; } };
}