Skip to content

Commit dae01e8

Browse files
committed
chore: use the obviously superior way to Unseconds()
1 parent eb7901c commit dae01e8

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

internal/k6runner/k6runner.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -313,8 +313,7 @@ func (dc *probeDurationCollector) process(_ *dto.MetricFamily, sample *model.Sam
313313
return nil
314314
}
315315

316-
// TODO: Is there a better way to convert from float seconds to time?
317-
dc.duration = time.Duration(sample.Value*1000) * time.Millisecond // This truncates to the nearest millisecond.
316+
dc.duration = time.Duration(float64(sample.Value) * float64(time.Second))
318317

319318
return nil
320319
}

0 commit comments

Comments
 (0)