Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
Signed-off-by: crazycs520 <[email protected]>
  • Loading branch information
crazycs520 committed Apr 3, 2024
1 parent cf99334 commit 0d7b8dc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 0 additions & 1 deletion util/execdetails.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
5 changes: 5 additions & 0 deletions util/misc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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())
}

0 comments on commit 0d7b8dc

Please sign in to comment.