Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Delay ¶
type Delay struct {
// contains filtered or unexported fields
}
Delay is not goroutine-safe.
func NewDelay ¶
func NewDelay(targetPercentile float64, increaseRate float64, initialDelay, minDelay, maxDelay time.Duration) (*Delay, error)
NewDelay returns a Delay.
targetPercentile is the desired percentile to be computed. For example, a targetPercentile of 0.99 computes the delay at the 99th percentile. Must be in the range [0, 1].
increaseRate (must be > 0) determines how many Increase calls it takes for Value to double.
Decrease can never lower the delay past minDelay, Increase can never raise the delay past maxDelay.
func (*Delay) Decrease ¶
func (d *Delay) Decrease()
Decrease notes that the RPC completed before the delay returned by Value.
func (*Delay) Increase ¶
func (d *Delay) Increase()
Increase notes that the RPC took longer than the delay returned by Value.
func (*Delay) PrintDelay ¶
func (d *Delay) PrintDelay()
PrintDelay prints the state of Delay object.
Click to show internal directories.
Click to hide internal directories.