Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
k-yomo committed Dec 30, 2022
1 parent d066424 commit d722c2b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions autoscaler/autoscaler.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,14 +153,14 @@ func (a *AutoScaler) CalcScalingOperation(ctx context.Context) (*ScalingOperatio
)
if shouldScaleOut {
scalingOperation.Reason = fmt.Sprintf(
"CPU utilization (currently '%f%%') is greater than the desired CPU utilization '%d%%' for %.0f seconds",
"CPU utilization (currently '%.1f%%') is greater than the desired CPU utilization '%d%%' for %.0f seconds",
currentCPUUtil,
autoScalingConfig.DesiredCPUUtilPercent,
autoScalingConfig.ScaleOutThresholdDuration.Seconds(),
)
} else if shouldScaleIn {
scalingOperation.Reason = fmt.Sprintf(
"CPU utilization (currently '%f%%') is less than the desired CPU utilization '%d%%' for %.0f seconds",
"CPU utilization (currently '%.1f%%') is less than the desired CPU utilization '%d%%' for %.0f seconds",
currentCPUUtil,
autoScalingConfig.DesiredCPUUtilPercent,
autoScalingConfig.ScaleInThresholdDuration.Seconds(),
Expand Down
2 changes: 1 addition & 1 deletion autoscaler/autoscaler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ func TestAutoScaler_CalcScalingOperation(t *testing.T) {
ToTopologySize: elasticcloud.NewTopologySize(SixtyFourGiBNodeNumToTopologySize(5)),
FromReplicaNum: 1,
ToReplicaNum: 9,
Reason: "CPU utilization is greater than the desired CPU utilization '50%' for 600 seconds",
Reason: "CPU utilization (currently '80.0%') is greater than the desired CPU utilization '50%' for 600 seconds",
},
},
{
Expand Down

0 comments on commit d722c2b

Please sign in to comment.