we have implemented custom Feeder which loads the data from Solr dynamically using Solr’s REST API before the main test (which stresses another API under test ) is being run.
This is happening as part of the scenario, e.g. every time the test is run the test data is being loaded from Solr into memory first.
It is quite a lengthy process - it takes 6 min to load the data. Let’s say the duration is set to 1 min. Gatling reports on the duration of the entire 7 min test run and not just 1 min for which we are interested to see the stats.
Can this behaviour be changed so that the time it takes feeder to load the data is not included in the test run. The reporting metrics are inaccurate as a result.
Indeed, you can only execute custom code in before and after hooks, not run Gatling DSL.
If you want to perform HTTP requests in there, you can use AsyncHttpClient (the HTTP client Gatling uses underneath) or even UrlConnection.