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

feat: openapi新增度量能力 #9638 #9670

Merged
merged 31 commits into from
Nov 14, 2023

Conversation

yongyiduan
Copy link
Collaborator

feat: openapi新增度量能力 #9638

perDay: Boolean
): Int {
return with(TOpenapiMetricsForApi.T_OPENAPI_METRICS_FOR_API) {
dslContext.batch(
Copy link
Member

Choose a reason for hiding this comment

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

建议都修改成 单条insert 多行的方式,更高效

): Int {
return with(TOpenapiMetricsForProject.T_OPENAPI_METRICS_FOR_PROJECT) {
dslContext.batch(
metricsApis.mapNotNull { metricsApi ->
Copy link
Member

Choose a reason for hiding this comment

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

建议都修改成 单条insert 多行的方式,更高效

}
val projects = mutableListOf<MetricsProjectData>()
esServiceImpl.executeElasticsearchQueryP(projects)
projectDao.createOrUpdate(dslContext, projects)
Copy link
Member

Choose a reason for hiding this comment

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

projects 可能会是一个极大的List, 组装DAO SQL可能会超出单条SQL提交的大小

Copy link
Member

Choose a reason for hiding this comment

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

esServiceImpl.executeElastisearchQueryP 遍历全量查询会否导致内存不足?假设有上百万个项目

}
apiDao.createOrUpdate(
dslContext = dslContext,
metricsApis = keyMap.values.toList(),
Copy link
Member

Choose a reason for hiding this comment

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

keyMap是 api 与 appcode/user 的笛卡尔积。 有可能也是一个非常大的数量

@bkci-bot bkci-bot merged commit 020ba51 into TencentBlueKing:master Nov 14, 2023
5 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.

4 participants