Documentation ¶
Overview ¶
Package replay provides semi-deterministic replayer.
Index ¶
Constants ¶
View Source
const DefaultMax = "10ms"
DefaultMax is the default max delay for DefaultReplayer.
View Source
const DefaultSeed = ""
DefaultSeed is the default seed for DefaultReplayer.
View Source
const DefaultZBias = "0.0"
DefaultZBias is the default zbias for DefaultReplayer.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BasicReplayer ¶
type BasicReplayer struct { // Debug is true if debugging mode. Debug bool // Seed is an arbitrary byte slice for replaying execution. // If seed is nil, it disables Replayer. Seed []byte // Max is the max value for delays injected by Replayer. Max time.Duration // ZBias is the probability of enforcing the delay to be zero. ZBias float64 // contains filtered or unexported fields }
BasicReplayer is an instance of Replayer.
func (*BasicReplayer) Inject ¶
func (r *BasicReplayer) Inject(context []byte)
Inject injects a random delay using context. The delay can be replayed with the seed value. Context can be nil.
type NopReplayer ¶
type NopReplayer struct { }
NopReplayer is an instance of Replayer but it does nothing.
func (*NopReplayer) Inject ¶
func (r *NopReplayer) Inject(context []byte)
Inject injects a random delay using context. The delay can be replayed with the seed value. Context can be nil.
Click to show internal directories.
Click to hide internal directories.