Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions operator/autoscaler.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,13 @@ func (as *AutoScaler) GetScalingOperation() (*ScalingOperation, error) {

managedIndices := as.getManagedIndices(esIndices, esShards)
managedNodes := as.getManagedNodes(as.pods, esNodes)

as.logger.Debugf("Calculating scaling operation for: hint=%s, managedIndices=%d, managedNodes=%d",
direction,
len(managedIndices),
len(managedNodes),
)

return as.calculateScalingOperation(managedIndices, managedNodes, direction), nil
}

Expand Down Expand Up @@ -214,6 +221,19 @@ func (as *AutoScaler) calculateScalingOperation(managedIndices map[string]ESInde
return noopScalingOperation(fmt.Sprintf("Scaling would violate the minimum required disk free percent: %.2f", 75.0))
}

as.logger.Infof("Scaling operation: direction=%s, nodeReplicas=%s, indexReplicaChanges=%d, targetIndexReplicas=%v, description=%s",
scalingOperation.ScalingDirection,
func() string {
if scalingOperation.NodeReplicas == nil {
return "unset"
}
return fmt.Sprintf("%d", *scalingOperation.NodeReplicas)
}(),
len(scalingOperation.IndexReplicas),
scalingOperation.IndexReplicas,
scalingOperation.Description,
)

return scalingOperation
}

Expand Down
Loading