waymond icon indicating copy to clipboard operation
waymond copied to clipboard

scaler(aws_ec2_asg): avoid multiple describe autoscaling group calls

Open scriptnull opened this issue 2 years ago • 0 comments

When we evaluate a scaling event in aws_ec2_asg scaler, we are currently making the API call to get a list of ASGs twice.

https://github.com/scriptnull/waymond/blob/3dee33fba1f58cafae800d71d1a0efaa2f7c9e49/internal/scaler/awsec2asg/aws_ec2_asg.go#L118-L125

https://github.com/scriptnull/waymond/blob/3dee33fba1f58cafae800d71d1a0efaa2f7c9e49/internal/scaler/awsec2asg/aws_ec2_asg.go#L300-L307

This can be refactored to make it once if the ASG is detected in the first call spot.

scriptnull avatar May 25 '23 02:05 scriptnull