Quellcode durchsuchen

Fix small bug in math if target is full.

master
rewby vor 8 Monaten
Ursprung
Commit
fe2c9c2d0f
1 geänderte Dateien mit 5 neuen und 2 gelöschten Zeilen
  1. +5
    -2
      cmd/dispatcher/state.go

+ 5
- 2
cmd/dispatcher/state.go Datei anzeigen

@@ -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)


Laden…
Abbrechen
Speichern