Skip to content

Commit 18838ff

Browse files
authored
Use the newer/better progress bar API that includes max on screen update rate to not slow down downloads (#162)
1 parent be57c36 commit 18838ff

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ go 1.20
55
require (
66
fortio.org/cli v1.9.2
77
fortio.org/log v1.17.1
8-
fortio.org/progressbar v0.6.0
8+
fortio.org/progressbar v0.7.0
99
fortio.org/testscript v0.3.2
1010
fortio.org/version v1.0.4
1111
)

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ fortio.org/cli v1.9.2 h1:17eJ8QZPjXHcLBpeCe0QMO/0fj5Bw0ZTxVgL7V9jOqc=
22
fortio.org/cli v1.9.2/go.mod h1:7r55OoTV8NXcTvJT4boWk8s3I2LP6TMZh/0LLMJEYw0=
33
fortio.org/log v1.17.1 h1:YQoGyZBnXTVIs77/nZw7BppwSOIamP3I092PGBenBZs=
44
fortio.org/log v1.17.1/go.mod h1:t58Spg9njjymvRioh5F6qKGSupEsnMjXLGWIS1i3khE=
5-
fortio.org/progressbar v0.6.0 h1:3v046h92YsWnBLEghtx1d2pBLLqNvMzMA4ANU0rZFXg=
6-
fortio.org/progressbar v0.6.0/go.mod h1:VZJJVUViaL7WqlQrB8jeeewVM+BTQBLzZ/KTJX+NZF4=
5+
fortio.org/progressbar v0.7.0 h1:aijGyCAem5nJWPkuth2qh1HPgRFgNby4Lp4Lh/2PIRg=
6+
fortio.org/progressbar v0.7.0/go.mod h1:VZJJVUViaL7WqlQrB8jeeewVM+BTQBLzZ/KTJX+NZF4=
77
fortio.org/struct2env v0.4.1 h1:rJludAMO5eBvpWplWEQNqoVDFZr4RWMQX7RUapgZyc0=
88
fortio.org/struct2env v0.4.1/go.mod h1:lENUe70UwA1zDUCX+8AsO663QCFqYaprk5lnPhjD410=
99
fortio.org/testscript v0.3.2 h1:ks5V+Y6H6nmeGqnVlZuLdiFwpqXemDkEnyGgCZa/ZNA=

mc/mc.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -365,9 +365,9 @@ func oneRequest(i int, cfg *Config, result *ResultStats, addr net.IP,
365365
}
366366
reader := resp.Body
367367
if !cfg.NoProgressBar {
368-
pb := progressbar.NewAutoReader(resp.Body, resp.ContentLength)
369-
pb.Prefix = fmt.Sprintf("%2d ", i)
370-
reader = pb
368+
bar := progressbar.NewBar()
369+
bar.Prefix = fmt.Sprintf("%2d ", i)
370+
reader = progressbar.NewAutoReader(bar, resp.Body, resp.ContentLength)
371371
}
372372
data, err := io.ReadAll(reader)
373373
_ = reader.Close() // will close resp.Body too when using the progressbar wrapper.

0 commit comments

Comments
 (0)