mirror of
https://github.com/minio/minio.git
synced 2024-12-24 22:25:54 -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
|
// previous results
|
||||||
func (dt *dynamicTimeout) adjust(entries [dynamicTimeoutLogSize]time.Duration) {
|
func (dt *dynamicTimeout) adjust(entries [dynamicTimeoutLogSize]time.Duration) {
|
||||||
|
|
||||||
failures, average := 0, 0
|
failures, average := 0, int64(0)
|
||||||
for i := 0; i < len(entries); i++ {
|
for i := 0; i < len(entries); i++ {
|
||||||
if entries[i] == maxDuration {
|
if entries[i] == maxDuration {
|
||||||
failures++
|
failures++
|
||||||
} else {
|
} else {
|
||||||
average += int(entries[i])
|
average += int64(entries[i])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if failures < len(entries) {
|
if failures < len(entries) {
|
||||||
average /= len(entries) - failures
|
average /= int64(len(entries) - failures)
|
||||||
}
|
}
|
||||||
|
|
||||||
timeOutHitPct := float64(failures) / float64(len(entries))
|
timeOutHitPct := float64(failures) / float64(len(entries))
|
||||||
|
Loading…
Reference in New Issue
Block a user