Skip to content

Commit

Permalink
Don't do metrics autoscaling unless enabled on table
Browse files Browse the repository at this point in the history
Signed-off-by: Bryan Boreham <bryan@weave.works>
  • Loading branch information
bboreham committed Oct 30, 2018
1 parent 2d5a0c1 commit 1cc9cb9
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions aws/metrics_autoscaling.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand All @@ -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:
Expand Down

0 comments on commit 1cc9cb9

Please sign in to comment.