Inconsistent request counts in reports

I recorded a session with a web application that consists of 1581 requests. The requests are mainly HTML files and REST API calls, but there are also requests for JavaScript, CSS, and image files. I have modified the simulation to use a configurable number of users and to perform 4 loops over the recorded request chain. The problem I have observed is that the total request count in the reports is never 1581 or an integer multiple of 1581, and will vary from run to run with the same number of users. The fact that the total request count is not repeatable is very troubling. Why would this happen?

With respect to the requests for the JavaScript and CSS files, the name of the JavaScript or CSS file often appears in the reports in place of the corresponding request name, and sometimes both the JavaScript or CSS filename and the corresponding request name appear in the reports. When both the JavaScript or CSS filename and the request name appear in the results, the total number of requests is always more than the expected total, so in many cases there is double counting of a request, which would explain the problem described in the first paragraph. Also, the request with the name of the JavaScript or CSS file appears to have the expected count, while the request with the request name has a lower count than the expected one, and occasionally, much lower. and is not consistent from one run to another. It almost seems like these requests are being counted in some random fashion.

I just started using Gatling recently, so it is entirely possible I am doing something wrong. If I am, could someone please suggest what that might be?

My goal is to include load tests into a build process, and I would expect the results need to be consistent to do that successfully.


PS: I am currently using version 2.1.7. I have reviewed the release notes regarding migrating from 2.1.x to 2.2.1, and it does not look like I would need to modify the simulation code, so I could easily migrate to the newer version if that would help.

Most likely, your requests are served with a Expires or Cache-Control header that forces your virtual users to skip some requests.
Gatling caching is enabled by default.