You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func (s *Storage) GetLatestStartTimeAuditPlanSQLV2(sourceId uint, typ string) (string, error) {
+ if typ == "" {+ return "", errors.New("invalid type parameter")+ }
info := struct {
StartTime string `gorm:"column:max_start_time"`
}{}
err := s.db.Raw(`SELECT MAX(STR_TO_DATE(JSON_UNQUOTE(JSON_EXTRACT(info, '$.start_time_of_last_scraped_sql')), '%Y-%m-%dT%H:%i:%s.%f'))
AS max_start_time FROM sql_manage_records WHERE source_id = ? AND source = ? AND deleted_at is NULL`, sourceId, typ).Scan(&info).Error
return info.StartTime, err
}
Suggestion importance[1-10]: 7
__
Why: The suggestion adds a check to validate the typ parameter, which improves error handling and prevents potential SQL query issues. While this strengthens robustness, it is a moderate enhancement rather than a critical fix.
Why: The suggestion correctly removes the extra trailing space in the translation string for ApMetricNameLockWaitTimeAvg, ensuring consistency in the text style. Its impact is minor, addressing only a small formatting issue.
Why: The suggestion correctly removes a trailing space from the value of ApMetricNameLockWaitTimeAvg, which improves consistency. The change is minor but beneficial for internationalization consistency.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
User description
关联的 issue
link: https://github.com/actiontech/sqle-ee/issues/1639
描述你的变更
支持TDSQL 监控库社区版变更
确认项(pr提交后操作)
Tip
请在指定复审人之前,确认并完成以下事项,完成后✅
not_compatible
need_update_doc
Description
新增监控库指标国际化翻译
更新SQL查询增加过滤条件
添加监控库相关指标常量映射
Changes walkthrough 📝
message_zh.go
新增监控库指标中文描述
sqle/locale/message_zh.go
instance_audit_plan.go
更新 SQL 查询函数
sqle/model/instance_audit_plan.go
metrics.go
新增监控库指标常量映射
sqle/server/auditplan/metrics.go
active.en.toml
新增监控库指标英文翻译
sqle/locale/active.en.toml
active.zh.toml
新增监控库指标中文翻译
sqle/locale/active.zh.toml