INNER CODE UNIT · TypeScript
printProgressDashboard
SveltyCMS/SveltyCMS · scripts/benchmark-matrix/index.ts:480
function printProgressDashboard(opts: {
groupName: string;
groupDone: number;
groupTotal: number;
runningCount: number;
completedGlobal: number;
totalGlobal: number;
testEtaSeconds: number;
globalEtaSeconds: number;
}) {
const width = 16;
const percent = Math.min(100, Math.max(0, (opts.completedGlobal / opts.totalGlobal) * 100));
const filled = Math.round((width * percent) / 100);
const bar = "\u2588".repeat(filled) + "\u2591".repeat(width - filled);
const active = opts.runningCount > 0 ? ` (${opts.runningCount} active)` : "";
const testEta = opts.runningCount > 0 ? ` | Test ETA: ${formatTime(opts.testEtaSeconds)}` : "";
const line1 = ` \u2192 Group [${opts.groupName}]: ${opts.groupDone}/${opts.groupTotal} passed${active}${testEta}`;
const line2 = ` \uD83D\uDCCA ${bar} ${Math.round(percent)}% | ${opts.completedGlobal}/${opts.totalGlobal} done | Total: ${formatTime(opts.globalEtaSeconds)}`;