Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckParams ¶
func CheckParams(p *ModuleParams) error
func NewModule ¶
func NewModule(mc ModuleConfig, params *ModuleParams) (modules.PassiveModule, error)
NewModule returns a new instance of the event mangler module. The event mangler probabilistically drops or delays all incoming events. The drop rate and interval of possible delays is determined by the params argument.
Types ¶
type ModuleParams ¶
type ModuleParams struct { // All events that are not dropped are delayed at least by MinDelay. MinDelay time.Duration // All events that are not dropped are delayed by a time chosen uniformly at random between MinDelay and MaxDelay. MaxDelay time.Duration // Number between 0 and 1 indicating the probability with which an incoming event is dropped. DropRate float32 // Source of randomness used for random decisions. // If set to nil, a new pseudo-random generator will be used. Rand *rand.Rand }
func DefaultParams ¶
func DefaultParams() *ModuleParams
Click to show internal directories.
Click to hide internal directories.