Ver a proveniência

Fix small bug in math if target is full.

master
rewby há 8 meses
ascendente
cometimento
fe2c9c2d0f
1 ficheiros alterados com 5 adições e 2 eliminações
  1. +5
    -2
      cmd/dispatcher/state.go

+ 5
- 2
cmd/dispatcher/state.go Ver ficheiro

@@ -188,8 +188,11 @@ func (state *State) UpdateThread() {
inflightsSum := int64(0)
inflightsCount := 0
for _, t := range targets {
inflightsSum = inflightsSum + t.Inflight
inflightsCount = inflightsCount + 1
// Only count targets that can actually handle inbound in this calculation.
if t.FreeSpace > int64(t.Target.MinimumFreeSpace) {
inflightsSum = inflightsSum + t.Inflight
inflightsCount = inflightsCount + 1
}
}
averageInflights := float64(inflightsSum) / float64(inflightsCount)
log.Debugf("Average inflights: %v", averageInflights)


Carregando…
Cancelar
Guardar