Skip to content

Commit

Permalink
add a helper function for new ru details (tikv#1078)
Browse files Browse the repository at this point in the history
Signed-off-by: glorv <[email protected]>
  • Loading branch information
glorv authored Dec 20, 2023
1 parent 6f9ba83 commit 4ce1e45
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions util/execdetails.go
Original file line number Diff line number Diff line change
Expand Up @@ -703,6 +703,16 @@ func NewRUDetails() *RUDetails {
}
}

// NewRUDetails creates a new RUDetails with specifical values.
// This function is used in tidb's unit test.
func NewRUDetailsWith(rru, wru float64, waitDur time.Duration) *RUDetails {
return &RUDetails{
readRU: uatomic.NewFloat64(rru),
writeRU: uatomic.NewFloat64(wru),
ruWaitDuration: uatomic.NewDuration(waitDur),
}
}

// Clone implements the RuntimeStats interface.
func (rd *RUDetails) Clone() *RUDetails {
return &RUDetails{
Expand Down

0 comments on commit 4ce1e45

Please sign in to comment.