Skip to content

Commit

Permalink
resource_manager: fix missing kvCPUTime when sqlCPUTime is 0 (#5903)
Browse files Browse the repository at this point in the history
ref #5854

Signed-off-by: glorv <glorvs@163.com>
  • Loading branch information
glorv authored Feb 2, 2023
1 parent 18df271 commit 7fb70d1
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pkg/mcs/resource_manager/server/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -204,8 +204,10 @@ func (m *Manager) backgroundMetricsFlush(ctx context.Context) {
writeByteMetrics.Observe(consumption.WriteBytes)
}
// CPU time info.
if consumption.SqlLayerCpuTimeMs != 0 {
sqlCPUMetrics.Observe(consumption.SqlLayerCpuTimeMs)
if consumption.TotalCpuTimeMs > 0 {
if consumption.SqlLayerCpuTimeMs > 0 {
sqlCPUMetrics.Observe(consumption.SqlLayerCpuTimeMs)
}
kvCPUMetrics.Observe(consumption.TotalCpuTimeMs - consumption.SqlLayerCpuTimeMs)
}
// RPC count info.
Expand Down

0 comments on commit 7fb70d1

Please sign in to comment.