diff --git a/util/execdetails.go b/util/execdetails.go index b3c377cec..b49298d21 100644 --- a/util/execdetails.go +++ b/util/execdetails.go @@ -635,7 +635,6 @@ func (td *TimeDetail) String() string { return "" } buf := bytes.NewBuffer(make([]byte, 0, 16)) - buf.WriteString("time_detail: {") if td.ProcessTime > 0 { buf.WriteString("total_process_time: ") buf.WriteString(FormatDuration(td.ProcessTime)) diff --git a/util/misc_test.go b/util/misc_test.go index ae819ac7f..304b70e22 100644 --- a/util/misc_test.go +++ b/util/misc_test.go @@ -88,3 +88,8 @@ func TestCompatibleParseGCTime(t *testing.T) { assert.NotNil(err) } } + +func TestTimeDetail(t *testing.T) { + detail := &TimeDetail{KvReadWallTime: time.Millisecond * 2, TotalRPCWallTime: time.Millisecond * 3} + assert.Equal(t, "time_detail: {total_kv_read_wall_time: 2ms, tikv_wall_time: 3ms}", detail.String()) +}