FrankChen021 commented on code in PR #19697:
URL: https://github.com/apache/druid/pull/19697#discussion_r3595287442
##########
indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/supervisor/autoscaler/CostBasedAutoScaler.java:
##########
@@ -326,6 +330,15 @@ int computeOptimalTaskCount(CostMetrics metrics)
);
emitter.emit(getMetricBuilder().setMetric(OPTIMAL_LAG_COST_METRIC,
optimalCost.lagCost()));
emitter.emit(getMetricBuilder().setMetric(OPTIMAL_IDLE_COST_METRIC,
optimalCost.idleCost()));
+
+ final double costDropPercent = (currentCost.totalCost() -
optimalCost.totalCost()) / currentCost.totalCost();
+ if (costDropPercent < config.getMinCostDropPercentForScaling()) {
Review Comment:
[P1] Compare the cost drop in percentage units
`costDropPercent` is currently a fraction in the range 0-1, while the
integer configuration represents a percentage (the added serde test uses `10`).
Consequently, configuring a 10% threshold makes every possible improvement
compare below 10 and disables all scaling; even a value of 1 requires a full
100% cost reduction. Multiply the computed ratio by 100 or normalize the
configured value before comparing, and add a scaling-behavior test for a
nonzero threshold.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]