mirror of
https://github.com/nxshock/gwp.git
synced 2024-11-27 03:31:02 +05:00
Do not show zero estimate count
This commit is contained in:
parent
c25093e8e2
commit
2a342398b9
9
gwp.go
9
gwp.go
@ -87,8 +87,13 @@ func (workerPool *WorkerPool) printProgress() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fmt.Fprintf(os.Stderr, newLine)
|
fmt.Fprintf(os.Stderr, newLine)
|
||||||
fmt.Fprintf(os.Stderr, "Progress: %.1f%% (%d / %d)",
|
|
||||||
float64(workerPool.processedCount*100)/float64(workerPool.EstimateCount), workerPool.processedCount, workerPool.EstimateCount)
|
if workerPool.EstimateCount == 0 {
|
||||||
|
fmt.Fprintf(os.Stderr, "Progress: %d", workerPool.processedCount)
|
||||||
|
} else {
|
||||||
|
fmt.Fprintf(os.Stderr, "Progress: %.1f%% (%d / %d)",
|
||||||
|
float64(workerPool.processedCount*100)/float64(workerPool.EstimateCount), workerPool.processedCount, workerPool.EstimateCount)
|
||||||
|
}
|
||||||
|
|
||||||
if workerPool.errorCount > 0 {
|
if workerPool.errorCount > 0 {
|
||||||
fmt.Fprintf(os.Stderr, " Errors: %d (%.1f%%)",
|
fmt.Fprintf(os.Stderr, " Errors: %d (%.1f%%)",
|
||||||
|
Loading…
Reference in New Issue
Block a user