Skip to content

Commit

Permalink
execdetails: add RRU/WRU interface of RURuntimeStats (#768)
Browse files Browse the repository at this point in the history
  • Loading branch information
nolouch authored Apr 19, 2023
1 parent 055f177 commit e1b0313
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 @@ -715,6 +715,16 @@ func (rs *RURuntimeStats) String() string {
return fmt.Sprintf("RRU:%f, WRU:%f", rs.readRU.Load(), rs.writeRU.Load())
}

// RRU returns the read RU.
func (rs RURuntimeStats) RRU() float64 {
return rs.readRU.Load()
}

// WRU returns the write RU.
func (rs RURuntimeStats) WRU() float64 {
return rs.writeRU.Load()
}

// Update updates the RU runtime stats with the given consumption info.
func (rs *RURuntimeStats) Update(consumption *rmpb.Consumption) {
if rs == nil || consumption == nil {
Expand Down

0 comments on commit e1b0313

Please sign in to comment.