forked from TrueCloudLab/xk6-frostfs
[#43] generator: Fix initial payload generation
Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
This commit is contained in:
parent
220a822377
commit
cea265a3f8
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