generator: Fix initial payload generation #43
1 changed files with 6 additions and 2 deletions
|
@ -40,11 +40,15 @@ func NewGenerator(vu modules.VU, size int) Generator {
|
||||||
if size <= 0 {
|
if size <= 0 {
|
||||||
panic("size should be positive")
|
panic("size should be positive")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
r := rand.New(rand.NewSource(time.Now().UnixNano()))
|
||||||
|
buf := make([]byte, size+TailSize)
|
||||||
|
r.Read(buf)
|
||||||
return Generator{
|
return Generator{
|
||||||
vu: vu,
|
vu: vu,
|
||||||
size: size,
|
size: size,
|
||||||
rand: rand.New(rand.NewSource(time.Now().UnixNano())),
|
rand: r,
|
||||||
buf: make([]byte, size+TailSize),
|
buf: buf,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue