Add log for new task count computation in CostBasedAutoScaler#18929
Merged
Conversation
CostBasedAutoScalerCostBasedAutoScaler
Fly-Style
force-pushed
the
cost-autoscaler-logs
branch
from
January 18, 2026 13:36
041382e to
dd5f8ab
Compare
| int currentTaskCount = 10; | ||
| int expectedOptimalCount = 17; // Higher than current | ||
|
|
||
| CostMetrics metrics = createMetrics(5000.0, currentTaskCount, PARTITION_COUNT, 0.1); |
Check notice
Code scanning / CodeQL
Unread local variable Note test
| ); | ||
| } | ||
|
|
||
| private void setupMocksForMetricsCollection(int taskCount, double avgLag, double pollIdleRatio) |
Check notice
Code scanning / CodeQL
Useless parameter Note test
cryptoe
approved these changes
Jan 19, 2026
| int taskCount = -1; | ||
| if (optimalTaskCount >= currentTaskCount) { | ||
| taskCount = optimalTaskCount; | ||
| log.info("New task count [%d]", taskCount); |
Contributor
There was a problem hiding this comment.
nit: should we also log the supervisor id for this ?
cryptoe
reviewed
Jan 20, 2026
| taskCount = optimalTaskCount; | ||
| log.info("New task count [%d] on supervisor [%s]", taskCount, supervisorId); | ||
| } else { | ||
| log.info("No scaling required for supervisor [%s]", supervisorId); |
Contributor
There was a problem hiding this comment.
How often does this func run ?
Worried a bit about log spam.
Contributor
Author
There was a problem hiding this comment.
Once per N minutes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Also this patch includes a mock-based tests for
computeTaskCountForScaleAction