mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-10 12:32:03 +00:00
Merge pull request #117544 from ruquanzhao/removeUndefinedConvert
fix undefined convertion
This commit is contained in:
commit
4d4d92808b
@ -724,7 +724,7 @@ func TestDifferentFlowsExpectEqual(t *testing.T) {
|
||||
}.exercise(t)
|
||||
}
|
||||
|
||||
// TestSeatSecondsRollover checks that there is not a problem with SeatSecons overflow.
|
||||
// TestSeatSecondsRollover checks that there is not a problem with SeatSeconds overflow.
|
||||
func TestSeatSecondsRollover(t *testing.T) {
|
||||
metrics.Register()
|
||||
now := time.Now()
|
||||
|
@ -38,7 +38,7 @@ const MinSeatSeconds = SeatSeconds(0)
|
||||
// This is intended only to produce small values, increments in work
|
||||
// rather than amount of work done since process start.
|
||||
func SeatsTimesDuration(seats float64, duration time.Duration) SeatSeconds {
|
||||
return SeatSeconds(math.Round(seats * float64(duration/time.Nanosecond) / (1e9 / ssScale)))
|
||||
return SeatSeconds(int64(math.Round(seats * float64(duration/time.Nanosecond) / (1e9 / ssScale))))
|
||||
}
|
||||
|
||||
// ToFloat converts to a floating-point representation.
|
||||
|
Loading…
Reference in New Issue
Block a user