From abe7b4ad54383b9dba2734bcf8673044824ea3d7 Mon Sep 17 00:00:00 2001 From: iwanghc Date: Thu, 21 Nov 2024 16:15:34 +0800 Subject: [PATCH] =?UTF-8?q?fix=EF=BC=9Aoracle=20top=20sql=20audit=20plan?= =?UTF-8?q?=20metric?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sqle/server/auditplan/metrics.go | 2 +- sqle/server/auditplan/task_type_oracle_topsql.go | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) 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 {