lila/data-pipeline/utils/progress-tracker.ts
2026-07-06 13:09:30 +02:00

27 lines
509 B
TypeScript

/**
* Simple progress tracker for pipeline execution.
*/
export class ProgressTracker {
private current: number;
private failed: number;
private total: number;
constructor(total: number) {
this.current = 0;
this.failed = 0;
this.total = total;
}
next(): number {
this.current++;
return this.current;
}
recordFailed(): void {
this.failed++;
}
format(label: string): string {
return `[${this.current}/${this.total}] (${this.failed} failed) ${label}`;
}
}