Skip to content

Commit

Permalink
SpeedPeak: make sure we don't divide by zero
Browse files Browse the repository at this point in the history
partially reverts: 9f15bb1
  • Loading branch information
vbauerster committed May 13, 2024
1 parent 4894291 commit a506a70
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion decorators.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ func (s *peak) EwmaUpdate(n int64, dur time.Duration) {

func (s *peak) Decor(stat decor.Statistics) (string, int) {
if stat.Completed && s.msg == "" {
if s.updCount != ewma.WARMUP_SAMPLES {
if s.min == 0 {
s.msg = "N/A"
} else {
s.msg = fmt.Sprintf(s.format, decor.FmtAsSpeed(decor.SizeB1024(math.Round(1e9/s.min))))
Expand Down

0 comments on commit a506a70

Please sign in to comment.