Skip to content

Commit 57fb4dd

Browse files
author
Andreas Drobisch
committed
add logs for the scaling operation
1 parent 74d94cf commit 57fb4dd

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

operator/autoscaler.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,13 @@ func (as *AutoScaler) GetScalingOperation() (*ScalingOperation, error) {
150150

151151
managedIndices := as.getManagedIndices(esIndices, esShards)
152152
managedNodes := as.getManagedNodes(as.pods, esNodes)
153+
154+
as.logger.Infof("Calculating scaling operation for: hint=%s, managedIndices=%d, managedNodes=%d",
155+
direction,
156+
len(managedIndices),
157+
len(managedNodes),
158+
)
159+
153160
return as.calculateScalingOperation(managedIndices, managedNodes, direction), nil
154161
}
155162

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

224+
as.logger.Infof("Scaling operation: direction=%s, nodeReplicas=%v, indexReplicaChanges=%d, description=%s",
225+
scalingOperation.ScalingDirection,
226+
scalingOperation.NodeReplicas,
227+
len(scalingOperation.IndexReplicas),
228+
scalingOperation.Description,
229+
)
230+
217231
return scalingOperation
218232
}
219233

0 commit comments

Comments
 (0)