wip
This commit is contained in:
parent
cc89f0c75c
commit
afd28d934e
26 changed files with 2103 additions and 427 deletions
27
data-pipeline/utils/progress-tracker.ts
Normal file
27
data-pipeline/utils/progress-tracker.ts
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
/**
|
||||
* 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}`;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue