Gatling custom action need

Gatling version: 3.14.7
Gatling flavor: java
Gatling build tool: gradle

Hi,

Question 1: can we write async code or completable future function call on .exec?

I’m writing custom Gatling actions in Java to test a system with multiple microservices. My main goal is to accurately track the end-to-end response time, specifically from when a Kafka message is sent to when a response is received via socketio.
I’m currently implementing custom actions for both Kafka producer and socket io client. However, I’m wondering:
Is it necessary to create a separate custom Gatling Action for each step (Kafka send, socket io receive), or can I just call my Java functions directly in .exec and use a single custom action to log the send/receive metrics?
What are the advantages of using custom actions for each operation versus just using Java functions in .exec?
I only need the metrics for the total time between send and receive, so I’m trying to understand the best practice for this scenario.

Hi!

exec blocks don’t provide metrics and measurements. The dummy sampler can provide metrics with the specific name and status. As a result a combination of

  • exec with the try-catch and the setting of session variables for the status and duration
  • dummy with the response time and status from the session variables

can works like an action. It can be a good solution for a scenario with a few operations

An action will encapsulate this logic with doing and measuring. Actions can be a good solution for scenarios with a lot of operations and some custom error messages

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.