jrasell / sherpa

Sherpa is a highly available, fast, and flexible horizontal job scaling for HashiCorp Nomad. It is capable of running in a number of different modes to suit different requirements, and can scale based on Nomad resource metrics or external sources.
Mozilla Public License 2.0
163 stars 8 forks source link

autoscale: provide additional decision context on scaling choices #86

Closed jrasell closed 4 years ago

jrasell commented 4 years ago

When the autoscaler performs its logic to figure out whether a scaling event should be triggered, it uses a case statement to check if thresholds are broken. The problem with this is that the first match is used, which is correct, but doesn't provide a great amount of detail. It is possible that both out and in actions are desired by different resources, or that multiple resources both require the same action.

This change allows for greater insight into the scaling decision made by the autoscaler calculation. It helps operators understand if changes need to be made to group resource settings, or exactly which thresholds were broken.

jrasell commented 4 years ago

fyi @commarla

commarla commented 4 years ago

Nice ! I like it. The behaviour is the same and the new message is crystal clear.