On 10 February 2012 16:26, Bruce Ide <[email protected]> wrote: > In the same thread you can use vars.putObject in a bsf or beanshell sampler > to store an array in a variable. Or you can just iteratively create a > jmeter array. > > I wrote an addon to allow sharing across threads, see > https://github.com/FlyingRhenquest/JmeterThreadGlobal. It's a pretty simple > addon and isn't currently set up to share arbitrary objects, but it should > be easy to modify to do that. > > If you used the new setup things you shouldn't have to synchronize between > the threads. If it turns out you need to, you can use a synchronizing timer > or my thread synchronization sampler (Which is also on github.) > > All this does add quite a bit of complexity to the test though, so if > you're ever going to need to explain it to another tester you might want to > simplify your test design.
Very good point. Why not create CSV data files containing the tokens in a separate test phase? You can then randomise the data file if you want. By the way, you say each thread picks a random token. If you have multiple threads, a simple random choice will sometimes result in two threads having the same token. Is that allowed? If not, the token entries will have to be marked as used; this will necessarily entail synchronising across threads. The CSV data file can be set to only be used once; threads cannot then get the same token (unless it is duplicated in the file). If you have hundreds or thousands of tokens, using a data file is the way to go. > -- > Bruce Ide > [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
