Reputation: 2996
I would like to use jmeter, but I need to get it to generate random numbers using a gaussian distribution. Any idea on how to achieve that? All I can see is a Minimum Value and a Maximum Value for the random variable config element
Thanks
Upvotes: 0
Views: 306
Reputation: 1999
Use JSR223 Pre or Post processor depend on your requirement to generate random using Gaussian distribution. Below is the code:-
rnd = new Random()
result = (1..1000).inject([]) { r, i -> r << rnd.nextGaussian() }
log.info ">>>>>>>>>>>>>>>>>"+result
Below is the reference from where I have got this. https://rosettacode.org/wiki/Random_numbers#Groovy
One more reference, for Java and many others:- http://www.cs.yale.edu/homes/spielman/ECC/gauss.html
Hope this helps.
Upvotes: 1