From b2151d1ada25bfb2b3096a85cdbf1a2b09ddd7a4 Mon Sep 17 00:00:00 2001 From: Sam Stoelinga Date: Sat, 4 Nov 2023 22:54:46 -0700 Subject: [PATCH] make code easier to read --- autoscaler.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/autoscaler.go b/autoscaler.go index 8f44eacf..0270188f 100644 --- a/autoscaler.go +++ b/autoscaler.go @@ -36,11 +36,11 @@ func (a *Autoscaler) Start() { // by the user. // Note this uses the default queue size, not the current queue size. // the current queue size increases and decreases based on replica count - queueSize := a.FIFO.size - ceil := math.Ceil(flt) - scale := ceil / float64(queueSize) + concurrencyPerReplica := a.FIFO.size + normalized := flt / float64(concurrencyPerReplica) + ceil := math.Ceil(normalized) log.Printf("Average for deployment: %s: %v (ceil: %v), current wait count: %v", deploymentName, flt, ceil, waitCount) - a.Scaler.SetDesiredScale(deploymentName, int32(scale)) + a.Scaler.SetDesiredScale(deploymentName, int32(ceil)) } } }