Skip to content

Commit

Permalink
rebase and minor comment
Browse files Browse the repository at this point in the history
  • Loading branch information
raj-prince committed Sep 13, 2024
1 parent 325feb9 commit 3bed70c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 2 additions & 3 deletions storage/dynamic_delay.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,8 @@ func (d *dynamicDelay) decrease() {
d.unsafeDecrease()
}

// Update notes that the RPC either took longer than the delay or completed
// before the delay, depending on the specified latency.
func (d *dynamicDelay) Update(latency time.Duration) {
// update updates the delay value depending on the specified latency.
func (d *dynamicDelay) update(latency time.Duration) {
d.mu.Lock()
defer d.mu.Unlock()

Expand Down
2 changes: 1 addition & 1 deletion storage/dynamic_delay_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func applySamples(numSamples int, expectedValue float64, rnd *rand.Rand, d *dyna
func applySamplesWithUpdate(numSamples int, expectedValue float64, rnd *rand.Rand, d *dynamicDelay) {
for i := 0; i < numSamples; i++ {
randomDelay := time.Duration(-math.Log(rnd.Float64()) * expectedValue * float64(time.Second))
d.Update(randomDelay)
d.update(randomDelay)
}
}

Expand Down

0 comments on commit 3bed70c

Please sign in to comment.