mirror of
https://github.com/minio/minio.git
synced 2024-12-24 06:05:55 -05:00
Change average from int to int64 in order to support 32-bit systems. (#4921)
This commit is contained in:
parent
3e632a49ee
commit
f45e0a44b8
@ -88,16 +88,16 @@ func (dt *dynamicTimeout) logEntry(duration time.Duration) {
|
||||
// previous results
|
||||
func (dt *dynamicTimeout) adjust(entries [dynamicTimeoutLogSize]time.Duration) {
|
||||
|
||||
failures, average := 0, 0
|
||||
failures, average := 0, int64(0)
|
||||
for i := 0; i < len(entries); i++ {
|
||||
if entries[i] == maxDuration {
|
||||
failures++
|
||||
} else {
|
||||
average += int(entries[i])
|
||||
average += int64(entries[i])
|
||||
}
|
||||
}
|
||||
if failures < len(entries) {
|
||||
average /= len(entries) - failures
|
||||
average /= int64(len(entries) - failures)
|
||||
}
|
||||
|
||||
timeOutHitPct := float64(failures) / float64(len(entries))
|
||||
|
Loading…
Reference in New Issue
Block a user