-
Notifications
You must be signed in to change notification settings - Fork 506
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
Conversation
This reverts commit 7367fcb.
.../core/openapi/biz-openapi/src/main/kotlin/com/tencent/devops/openapi/dao/MetricsForApiDao.kt
Show resolved
Hide resolved
perDay: Boolean | ||
): Int { | ||
return with(TOpenapiMetricsForApi.T_OPENAPI_METRICS_FOR_API) { | ||
dslContext.batch( |
There was a problem hiding this comment.
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 -> |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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提交的大小
There was a problem hiding this comment.
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(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
keyMap是 api 与 appcode/user 的笛卡尔积。 有可能也是一个非常大的数量
…际情况进行定时任务的性能优化
…际情况进行定时任务的性能优化
feat: openapi新增度量能力 #9638