e2e: generate keys for more stable load (#7344) (#7353)

(cherry picked from commit babd3acb70)

Co-authored-by: Sam Kleinman <garen@tychoish.com>
This commit is contained in:
mergify[bot]
2021-11-30 15:52:42 -05:00
committed by GitHub
parent 151103042a
commit bd5a7428b9

View File

@@ -97,9 +97,9 @@ func loadGenerate(ctx context.Context, r *rand.Rand, chTx chan<- types.Tx, txSiz
case <-timer.C:
}
// We keep generating the same 100 keys over and over, with different values.
// This gives a reasonable load without putting too much data in the app.
id := rand.Int63() % 100 // nolint: gosec
// Constrain the key space to avoid using too much
// space, while reduce the size of the data in the app.
id := r.Int63n(100)
bz := make([]byte, txSize)
_, err := r.Read(bz)