diff --git a/sqle/server/auditplan/metrics.go b/sqle/server/auditplan/metrics.go index 9f2cc208f..3bc6cbdf8 100644 --- a/sqle/server/auditplan/metrics.go +++ b/sqle/server/auditplan/metrics.go @@ -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 diff --git a/sqle/server/auditplan/task_type_oracle_topsql.go b/sqle/server/auditplan/task_type_oracle_topsql.go index 851e1ac58..837be52bf 100644 --- a/sqle/server/auditplan/task_type_oracle_topsql.go +++ b/sqle/server/auditplan/task_type_oracle_topsql.go @@ -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 } @@ -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 {