Fly-Style commented on code in PR #18819: URL: https://github.com/apache/druid/pull/18819#discussion_r2620678050
########## indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/supervisor/autoscaler/WeightedCostFunction.java: ########## @@ -0,0 +1,324 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.apache.druid.indexing.seekablestream.supervisor.autoscaler; + +import org.apache.druid.java.util.common.logger.Logger; + +/** + * Weighted cost function combining lag, idle time, and change distance metrics. + * Uses adaptive bounds for normalization based on recent history. + */ +public class WeightedCostFunction Review Comment: Regarding: > Use actual metrics instead of normalized or adaptive bounds. If a supervisor once saw a lag of 100M, the adaptive ratio would make a lag of 1M seem very small (normalizedLag = 0.01 i.e. 1%). But in reality, a lag of 1M is bad too and needs to be given appropriate weight. > Always perform cost computation even if idleness is in the accepted range (0.2-0.6 in the PR). This would help us validate the correctness of the formula against real clusters by verifying that the current task count gives minimal cost. Implemented in the latest commit. Other than that, we need to discuss each other point :) Thanks in advance for your input, appreciate it A LOT! -- 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]
