Available in Extras With Libs Set
Redis Data Set since 1.1.3DescriptionRedis Data Set requires JMeter 2.10 or superior. Redis Data Set lets you extract data from a Redis source in 2 modes:
To use a Redis Data Set you must at least configure:
To use RANDOM_REMOVE mode you need to first insert data this way. Inserting in a Redis List:
JedisPoolConfig config = new JedisPoolConfig();
// Replace by your redis host
JedisPool pool = new JedisPool(config, "localhost");
Jedis jedis = null;
try {
jedis = pool.getResource();
for (int i = 0; i < 500; i++) {
// ccList will be used in Redis Data Set
jedis.lpush("ccList", ""+i);
}
}finally {
if(jedis != null) {
pool.returnResource(jedis);
}
}
You can then set Redis key to ccList. In the below example, we declare a Redis Data Set which exports cardNumber variable from a ccList and then use it in a Debug Sampler: [/img/wiki/redis/TestPlanWithRedisList.png] To use RANDOM_GET mode you need to first insert data this way. Inserting in a Redis Set:
JedisPoolConfig config = new JedisPoolConfig();
// Replace by your redis host
JedisPool pool = new JedisPool(config, "localhost");
Jedis jedis = null;
try {
jedis = pool.getResource();
for (int i = 0; i < 500; i++) {
// ccSet will be used in Redis Data Set
jedis.sadd("ccSet", ""+i);
}
}finally {
if(jedis != null) {
pool.returnResource(jedis);
}
}
You can then set Redis key to ccSet In the below example, we declare a Redis Data Set which exports cardNumber variable from a ccSet and then use it in a Debug Sampler:
Examples |
On this page:
|