-
Notifications
You must be signed in to change notification settings - Fork 42
how to run
OlgaCalderon edited this page Mar 31, 2023
·
5 revisions
You can create and run test plans for the consumer side, the producer side or both the consumer and the producer sides of the Kafka messages.
Here you will see how to create and run a test plan that includes both the producer and the consumer sides of the Kafka messages from JMeter.
- Create a new test plan in JMeter.
- Under Thread Group, add a Java Request sampler.
- In Name, assign a descriptive name for this sampler.
- (Optional) You may add any description for the sampler under Comments.
- In the dropdown box, choose com.sngular.kloadgen.sampler.KafkaProducerSampler.
- Provide the corresponding values for this sampler, as explained in Kafka Producer Sampler configuration.
- Under Thread Group, add the configuration elements for this sampler, as seen in Kafka producer configuration elements.
- In the value and key schema (file) configuration elements, complete the table with the corresponding information regarding Field Name, Field Type, Field Length, and Field Value List. Note: The values you include in Field Values List will be used by the random tool. Instead of creating random values, it will choose the values randomly between the ones included here.
- (Optional) You can assign sizes to any map or array field (
[10]
for arrays,[10:]
for maps). - If you want to assign a sequence to any field, see Sequences.
- If you want to assign an iterator to any field, see Iterators.
- Under Thread Group, add a new Java Request sampler.
- In Name, assign a descriptive name for this sampler.
- (Optional) You may add any description for the sampler under Comments.
- In the dropdown box, choose com.sngular.kloadgen.sampler.KafkaConsumerSampler.
- Provide the corresponding values for this sampler, as explained in Kafka Consumer Sampler configuration.
- Under Thread Group, add the configuration elements for this sampler, as seen in Kafka consumer configuration elements.
- Save the test plan.
- Run the test plan.
- Check your results.
The following screenshots show the load test process in JMeter: