@@ -786,10 +786,18 @@ const (
786
786
SlowLogStatsInfoStr = "Stats"
787
787
// SlowLogNumCopTasksStr is the number of cop-tasks.
788
788
SlowLogNumCopTasksStr = "Num_cop_tasks"
789
- // SlowLogCopProcessStr includes some useful information about cop-tasks' process time.
790
- SlowLogCopProcessStr = "Cop_process"
791
- // SlowLogCopWaitStr includes some useful information about cop-tasks' wait time.
792
- SlowLogCopWaitStr = "Cop_wait"
789
+ // SlowLogCopProcAvg is the average process time of all cop-tasks.
790
+ SlowLogCopProcAvg = "Cop_proc_avg"
791
+ // SlowLogCopProcP90 is the p90 process time of all cop-tasks.
792
+ SlowLogCopProcP90 = "Cop_proc_p90"
793
+ // SlowLogCopProcMax is the max process time of all cop-tasks.
794
+ SlowLogCopProcMax = "Cop_proc_max"
795
+ // SlowLogCopWaitAvg is the average wait time of all cop-tasks.
796
+ SlowLogCopWaitAvg = "Cop_wait_avg"
797
+ // SlowLogCopWaitP90 is the p90 wait time of all cop-tasks.
798
+ SlowLogCopWaitP90 = "Cop_wait_p90"
799
+ // SlowLogCopWaitMax is the max wait time of all cop-tasks.
800
+ SlowLogCopWaitMax = "Cop_wait_max"
793
801
// SlowLogMemMax is the max number bytes of memory used in this statement.
794
802
SlowLogMemMax = "Mem_max"
795
803
)
@@ -859,12 +867,14 @@ func (s *SessionVars) SlowLogFormat(txnTS uint64, costTime time.Duration, execDe
859
867
}
860
868
if copTasks != nil {
861
869
buf .WriteString (SlowLogPrefixStr + SlowLogNumCopTasksStr + SlowLogSpaceMarkStr + strconv .FormatInt (int64 (copTasks .NumCopTasks ), 10 ) + "\n " )
862
- buf .WriteString (SlowLogPrefixStr + SlowLogCopProcessStr + SlowLogSpaceMarkStr +
863
- fmt .Sprintf ("Avg_time: %v P90_time: %v Max_time: %v" , copTasks .AvgProcessTime ,
864
- copTasks .P90ProcessTime , copTasks .MaxProcessTime ) + "\n " )
865
- buf .WriteString (SlowLogPrefixStr + SlowLogCopWaitStr + SlowLogSpaceMarkStr +
866
- fmt .Sprintf ("Avg_time: %v P90_time: %v Max_time: %v" , copTasks .AvgWaitTime ,
867
- copTasks .P90WaitTime , copTasks .MaxWaitTime ) + "\n " )
870
+ buf .WriteString (SlowLogPrefixStr + fmt .Sprintf ("%v%v%v %v%v%v %v%v%v" ,
871
+ SlowLogCopProcAvg , SlowLogSpaceMarkStr , copTasks .AvgProcessTime .Seconds (),
872
+ SlowLogCopProcP90 , SlowLogSpaceMarkStr , copTasks .P90ProcessTime .Seconds (),
873
+ SlowLogCopProcMax , SlowLogSpaceMarkStr , copTasks .MaxProcessTime .Seconds ()) + "\n " )
874
+ buf .WriteString (SlowLogPrefixStr + fmt .Sprintf ("%v%v%v %v%v%v %v%v%v" ,
875
+ SlowLogCopWaitAvg , SlowLogSpaceMarkStr , copTasks .AvgWaitTime .Seconds (),
876
+ SlowLogCopWaitP90 , SlowLogSpaceMarkStr , copTasks .P90WaitTime .Seconds (),
877
+ SlowLogCopWaitMax , SlowLogSpaceMarkStr , copTasks .MaxWaitTime .Seconds ()) + "\n " )
868
878
}
869
879
if memMax > 0 {
870
880
buf .WriteString (SlowLogPrefixStr + SlowLogMemMax + SlowLogSpaceMarkStr + strconv .FormatInt (memMax , 10 ) + "\n " )
0 commit comments