Skip to content
This repository has been archived by the owner on Sep 9, 2020. It is now read-only.

Commit

Permalink
Merge pull request #85 from iadvize/fix-scaling-order
Browse files Browse the repository at this point in the history
fix(autoscaling): test out before in
  • Loading branch information
jrasell authored Oct 31, 2019
2 parents 6ad120c + 6f4d575 commit 4de23a8
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions pkg/autoscale/autoscale.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,6 @@ func (a *AutoScale) autoscaleJob(jobID string, policies map[string]*policy.Group
var count int

switch {
case cpuUsage < pol.ScaleInCPUPercentageThreshold:
scalingDir = scale.DirectionIn
count = pol.ScaleInCount
updateAutoscaleMeta(group, "cpu", cpuUsage, pol.ScaleInCPUPercentageThreshold, meta)
case memUsage < pol.ScaleInMemoryPercentageThreshold:
scalingDir = scale.DirectionIn
count = pol.ScaleInCount
updateAutoscaleMeta(group, "memory", memUsage, pol.ScaleInMemoryPercentageThreshold, meta)
case cpuUsage > pol.ScaleOutCPUPercentageThreshold:
scalingDir = scale.DirectionOut
count = pol.ScaleOutCount
Expand All @@ -85,6 +77,14 @@ func (a *AutoScale) autoscaleJob(jobID string, policies map[string]*policy.Group
scalingDir = scale.DirectionOut
count = pol.ScaleOutCount
updateAutoscaleMeta(group, "memory", memUsage, pol.ScaleOutMemoryPercentageThreshold, meta)
case cpuUsage < pol.ScaleInCPUPercentageThreshold:
scalingDir = scale.DirectionIn
count = pol.ScaleInCount
updateAutoscaleMeta(group, "cpu", cpuUsage, pol.ScaleInCPUPercentageThreshold, meta)
case memUsage < pol.ScaleInMemoryPercentageThreshold:
scalingDir = scale.DirectionIn
count = pol.ScaleInCount
updateAutoscaleMeta(group, "memory", memUsage, pol.ScaleInMemoryPercentageThreshold, meta)
}

if scalingDir != "" {
Expand Down

0 comments on commit 4de23a8

Please sign in to comment.