Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

perf: Job中的主机根据其对应业务的灰度情况展示Agent状态 #2492 #2604

Merged
merged 1 commit into from
Nov 9, 2023
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ public class AgentStateQueryConfig {
@Value("${gse.query.threads.num:5}")
private int gseQueryThreadsNum;

@Value("${gse.query.threads.maxNum:20}")
private int gseQueryThreadsMaxNum;

@Value("${gse.query.batchSize:5000}")
private int gseQueryBatchSize;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
import com.tencent.bk.job.common.gse.v2.GseV2ApiClient;
import com.tencent.bk.job.common.gse.v2.GseV2AutoConfiguration;
import io.micrometer.core.instrument.MeterRegistry;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.ObjectProvider;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
Expand All @@ -52,7 +53,7 @@
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;


@Slf4j
@Configuration(proxyBeanMethods = false)
@Import(
{
Expand All @@ -78,12 +79,16 @@ public ThreadPoolExecutor agentStatusQueryExecutor(MeterRegistry meterRegistry,
return new WatchableThreadPoolExecutor(
meterRegistry,
"agentStatusQueryExecutor",
agentStateQueryConfig.getGseQueryBatchSize(),
agentStateQueryConfig.getGseQueryBatchSize(),
agentStateQueryConfig.getGseQueryThreadsNum(),
agentStateQueryConfig.getGseQueryThreadsMaxNum(),
60,
TimeUnit.SECONDS,
new LinkedBlockingQueue<>(),
threadFactory
new LinkedBlockingQueue<>(agentStateQueryConfig.getGseQueryThreadsNum()),
threadFactory,
(r, executor) -> {
log.warn("agentStatusQueryExecutor busy, use current thread to query");
r.run();
}
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,7 @@ data:
connect:
string: {{ .Values.gse.server.zookeeper.connect.string }}
query:
threads:
num: {{ .Values.gse.query.threads.num }}
batchSize: {{ .Values.gse.query.batchSize }}
{{- toYaml .Values.gse.query | nindent 8 }}
script:
rootPath: {{ .Values.gse.script.rootPath }}
iam:
Expand Down
4 changes: 3 additions & 1 deletion support-files/kubernetes/charts/bk-job/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -474,8 +474,10 @@ gse:
rootPath: "/tmp/bkjob"
query:
threads:
# 向GSE查询Agent状态的并发数
# 向GSE查询Agent状态的核心并发数
num: 5
# 向GSE查询Agent状态的最大并发数
maxNum: 20
# 单次向GSE查询状态的Agent数量
batchSize: 5000

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ gse:
query:
threads:
num: 5
maxNum: 20
batchSize: 5000
script:
rootPath: "/tmp/bkjob"
Expand Down
Loading