Redis Data SetDescriptionRedis Data Set requests data from a Redis server and converts to JMeter variables. This allows data to be served from a single Redis server across multiple JMeter slave instances during a test, without needing to split the file or handle duplicate rows of data. The plugin has the following features:
Data is loaded to Redis under a key, where each entry is a string that is delimited into one or more variables. See Loading Data to Redis below. In the following example, there are 2 Redis databases, 0 and 1. Database 0 has 2 index keys, ccKeys and userName. +- 0 +- ccKeys +- "123456,1234" +- "123457,1235" +- "123458,1236" +- userName +- "user1" +- "user2" +- "user3" Redis Lists vs Sets =List * Data retrieved sequentially * Supports repeated or duplicate dataSet * Data retrieved randomly * Data is unique within the set (adding duplicate data is ignored)ConfigurationData ConfigurationThis section describes how the data is stored within Redis and how it should be mapped to JMeter Variables. All options in this section are mandatory.
Connection ConfigurationThe following options are mandatory:
The following options are optional:
Redis Pool ConfigurationThese options are controlled by the Apache Commons Pool library, and are described in more detail in the API page for that project. Loading Data to RedisIt is typically most efficient to load data to Redis using pipe mode, `redis-cli --pipe`. An input CSV file that looks like this: ccNum,expiryDate 123456,1234 123457,1235 123458,1236 would first need to be converted to a Redis-compatible input format before being loading into a List with an index key ccList: LPUSH ccList 123456,1234 LPUSH ccList 123457,1235 LPUSH ccList 123458,1236 or, in the case of a Set, with an index key ccSet: SADD ccSet 123456,1234 SADD ccSet 123457,1235 SADD ccSet 123458,1236 In the below example, we declare a Redis Data Set which exports cardNumber variable from a Redis List using a key ccList and then use it in a Debug Sampler: The JMX can be downloaded here. Technical DetailsThe RedisDataSet uses the Jedis Java Redis library for connection and access operations. Starting from version 0.6, RedisDataSet uses srandmember and lmove commands. For Redis versions below 6.2.0, you can define a "plugins.redis.legacy=true" property in jmeter.properties. For data loaded into a Redis set, RedisDataSet uses spop and sadd commands. For data loaded into a Redis list, RedisDataSet uses lpop and rpush commands. |
On this page:
|