how do I implement a random function based on a custom seed?
I need to create a random generator function/component for jmeter based on a custom seed to be able to exactly reproduce a test run which uses __RandomFunctions(). It should work the same way as built in random functions like __RandomDate() etc but based on an initial random seed.
Looking into the Jmeter source it looks like all built in random functions (__RandomDate etc) use ThreadLocalRandom which don't use a custom seed. I also looked into creating a Plugin but that will not help as I need to use it as a function from various samplers. So which is the best way to instantiate a new Random object with a seed and then call it with random.nextLong from various samplers. It doesn't need to be global, a random object per thread is fine. How can I do this the easiest way?
You can use __groovy() function for that, something like:
You can write your own JMeter Plugin implementing the above functionality
You can request an enhancement
You can suggest a contribution to existing Random function to introduce "seed" parameter