improved bundle cli output with progress
This commit is contained in:
parent
86cff37533
commit
3bc355e503
1 changed files with 6 additions and 3 deletions
|
|
@ -228,13 +228,16 @@ func main() {
|
||||||
log.Fatalf("Failed to write bundle %d: %v", job.index, err)
|
log.Fatalf("Failed to write bundle %d: %v", job.index, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
n := bundlesCreated.Add(1)
|
||||||
|
estimatedTotal := (totalHosts + cfg.EntriesPerBundle - 1) / cfg.EntriesPerBundle
|
||||||
|
if n%500 == 0 {
|
||||||
|
fmt.Printf(" %d/%d bundles\n", n, estimatedTotal)
|
||||||
|
}
|
||||||
|
|
||||||
logLine := fmt.Sprintf("bundle: %04d.json %dKB", job.index, len(job.data)/1024)
|
logLine := fmt.Sprintf("bundle: %04d.json %dKB", job.index, len(job.data)/1024)
|
||||||
fmt.Println(logLine)
|
|
||||||
if logWriter != nil {
|
if logWriter != nil {
|
||||||
logWriter.Write(logLine, false)
|
logWriter.Write(logLine, false)
|
||||||
}
|
}
|
||||||
|
|
||||||
bundlesCreated.Add(1)
|
|
||||||
totalBytes.Add(int64(len(job.data)))
|
totalBytes.Add(int64(len(job.data)))
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue