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: 脚本任务执行结果拉取优化 #2919 #2997

Merged
merged 12 commits into from
May 27, 2024

Conversation

wangyu096
Copy link
Collaborator

修改点

  1. 修改 job->gse API 超时时间为 60s
  2. 拉取 GSE 脚本任务执行结果API, 新增 limit参数,用于限制返回的内容长度
  3. 用户可根据环境,配置GSE 脚本任务执行结果查询 API 单次返回的执行输出内容长度(单位 byte)
  4. 通过对最大返回日志长度、执行对象数量的计算,动态构造 limit 条件

@wangyu096 wangyu096 requested a review from jsonwan May 27, 2024 07:32
scriptTask:
query:
# 脚本任务执行,从 GSE 查询结果的 API 单次返回的脚本执行输出内容最大长度(单位 byte)。该参数需要合理设置,避免因为输出日志太多导致拉取 GSE 执行结果 API 超时。
contentSizeLimit: 536870912
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

建议支持更加语义化的配置,如512MB,FileSizeUtil类中已提供解析方法。

scriptTask:
query:
# GSE 脚本任务执行结果查询 API 单次返回的执行输出内容长度(单位 byte)
contentSizeLimit: 536870912
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

建议支持更加语义化的配置,如512MB,FileSizeUtil类中已提供解析方法。

Copy link
Collaborator

@jsonwan jsonwan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1个小问题需要处理。

@wangyu096
Copy link
Collaborator Author

  1. 修改 FileSizeUtil.parseFileSizeBytes 方法入参校验。基础方法如果输入参数不合法不应该返回 null,而是应该直接抛出 IllegalArgumentException。该处修改不影响该方法当前调用方
  2. 日志大小限制参数支持 KB/MB/GB的配置方式

@jsonwan jsonwan merged commit d830b5a into TencentBlueKing:master May 27, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants