Skip to content

Commit

Permalink
util: add lock for MergeBasicStats (#38998)
Browse files Browse the repository at this point in the history
close #38994
  • Loading branch information
mengxin9014 authored Nov 10, 2022
1 parent 7f9219c commit d970c9b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions util/execdetails/execdetails.go
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,8 @@ func (crs *CopRuntimeStats) GetActRows() (totalRows int64) {

// MergeBasicStats traverses basicCopRuntimeStats in the CopRuntimeStats and collects some useful information.
func (crs *CopRuntimeStats) MergeBasicStats() (procTimes []time.Duration, totalTime time.Duration, totalTasks, totalLoops, totalThreads int32) {
crs.Lock()
defer crs.Unlock()
procTimes = make([]time.Duration, 0, 32)
for _, instanceStats := range crs.stats {
for _, stat := range instanceStats {
Expand Down

0 comments on commit d970c9b

Please sign in to comment.