From 1cc9cb96c175d45a7f1842391aaa5107e59d1ced Mon Sep 17 00:00:00 2001 From: Bryan Boreham Date: Tue, 30 Oct 2018 14:26:45 +0000 Subject: [PATCH] Don't do metrics autoscaling unless enabled on table Signed-off-by: Bryan Boreham --- aws/metrics_autoscaling.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/aws/metrics_autoscaling.go b/aws/metrics_autoscaling.go index 32acabbe23cb9..e4385a491b5f0 100644 --- a/aws/metrics_autoscaling.go +++ b/aws/metrics_autoscaling.go @@ -86,6 +86,12 @@ func (m *metricsData) DescribeTable(ctx context.Context, desc *chunk.TableDesc) } func (m *metricsData) UpdateTable(ctx context.Context, current chunk.TableDesc, expected *chunk.TableDesc) error { + // If we don't take explicit action, return the current provision as the expected provision + expected.ProvisionedWrite = current.ProvisionedWrite + + if !expected.WriteScale.Enabled { + return nil + } if err := m.update(ctx); err != nil { return err } @@ -95,9 +101,6 @@ func (m *metricsData) UpdateTable(ctx context.Context, current chunk.TableDesc, level.Info(util.Logger).Log("msg", "checking metrics", "table", current.Name, "queueLengths", fmt.Sprint(m.queueLengths), "errorRate", errorRate, "usageRate", usageRate) - // If we don't take explicit action, return the current provision as the expected provision - expected.ProvisionedWrite = current.ProvisionedWrite - switch { case errorRate < errorFractionScaledown*float64(current.ProvisionedWrite) && m.queueLengths[2] < float64(m.cfg.TargetQueueLen)*targetScaledown: