Skip to content

Commit

Permalink
Merge pull request #2775 from actiontech/fix_oracle_top_sql_metrics
Browse files Browse the repository at this point in the history
fix:oracle top sql audit plan metric
  • Loading branch information
taolx0 authored Nov 25, 2024
2 parents 8238597 + abe7b4a commit b86dccb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion sqle/server/auditplan/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ var ALLMetric = map[string]MetricType{
MetricNameMetaType: MetricTypeString, // MySQL schema meta
MetricNameRecordDeleted: MetricTypeBool, // MySQL schema meta

MetricNameQueryTimeTotal: MetricTypeInt, // DB2 TOP SQL | OB Oracle TOP SQL
MetricNameQueryTimeTotal: MetricTypeFloat, // DB2 TOP SQL | OB Oracle TOP SQL
MetricNameCPUTimeAvg: MetricTypeFloat, // DB2 TOP SQL | OB MySQL TOP SQL
MetricNameLockWaitTimeTotal: MetricTypeFloat, // DB2 TOP SQL
MetricNameLockWaitCounter: MetricTypeInt, // DB2 TOP SQL
Expand Down
8 changes: 4 additions & 4 deletions sqle/server/auditplan/task_type_oracle_topsql.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,10 @@ func (at *OracleTopSQLTaskV2) mergeSQL(originSQL, mergedSQL *SQLV2) {
originSQL.Info.SetFloat(MetricNameCPUTimeTotal, mergedSQL.Info.Get(MetricNameCPUTimeTotal).Float())

// // MetricNameDiskReadTotal
originSQL.Info.SetFloat(MetricNameDiskReadTotal, mergedSQL.Info.Get(MetricNameDiskReadTotal).Float())
originSQL.Info.SetInt(MetricNameDiskReadTotal, mergedSQL.Info.Get(MetricNameDiskReadTotal).Int())

// MetricNameBufferGetCounter
originSQL.Info.SetFloat(MetricNameBufferGetCounter, mergedSQL.Info.Get(MetricNameBufferGetCounter).Float())
originSQL.Info.SetInt(MetricNameBufferGetCounter, mergedSQL.Info.Get(MetricNameBufferGetCounter).Int())
return
}

Expand Down Expand Up @@ -148,8 +148,8 @@ func (at *OracleTopSQLTaskV2) ExtractSQL(logger *logrus.Entry, ap *AuditPlan, pe
info.SetFloat(MetricNameQueryTimeTotal, float64(sql.ElapsedTime))
info.SetFloat(MetricNameUserIOWaitTimeTotal, float64(sql.UserIOWaitTime))
info.SetFloat(MetricNameCPUTimeTotal, float64(sql.CPUTime))
info.SetFloat(MetricNameDiskReadTotal, float64(sql.DiskReads))
info.SetFloat(MetricNameBufferGetCounter, float64(sql.BufferGets))
info.SetInt(MetricNameDiskReadTotal, sql.DiskReads)
info.SetInt(MetricNameBufferGetCounter, sql.BufferGets)
sqlV2.GenSQLId()
err = at.AggregateSQL(cache, sqlV2)
if err != nil {
Expand Down

0 comments on commit b86dccb

Please sign in to comment.