Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var (
// None represents zero no-op latency model.
None = none{}
)
Functions ¶
This section is empty.
Types ¶
type LogNormal ¶
type LogNormal struct {
// contains filtered or unexported fields
}
LogNormal represents a log normal latency distribution with a configurable mean latency. This latency model does not specialise based on host clock time nor participants.
func NewLogNormal ¶
NewLogNormal instantiates a new latency model of log normal latency distribution with the given mean. This model will always return zero if mean latency duration is less than or equal to zero.
func (*LogNormal) Sample ¶
Sample returns latency samples that correspond to the log normal distribution with the configured mean. The samples returned disregard time and participants, i.e. all the samples returned correspond to a fixed log normal distribution. Latency from one participant to another may be asymmetric and once generated remains constant for the lifetime of a simulation.
Note, when mean configured latency is not larger than zero the latency sample will always be zero.
type Model ¶
type Model interface { // Sample returns an artificial latency at time t for communications from a // participant to another participant. // // See: gpbft.Host, gpbft.Clock. Sample(t time.Time, from, to gpbft.ActorID) time.Duration }
Model represents a latency model of cross participant communication. The model offers the ability for implementation of varying latency across a simulation, as well as specialised latency across specific participants.
See LogNormal, Zipf, None.
type Zipf ¶
type Zipf struct {
// contains filtered or unexported fields
}
Zipf represents a log normal latency distribution with a configurable max latency. This latency model does not specialise based on host clock time nor participants.
func NewZipf ¶
NewZipf instantiates a new latency model of ZipF latency distribution with the given max.