jenkinsgatlinggatling-plugin

Can Jenkins Gatling plugin show the different paths


Is there a way to get the gatling requests in the Gatling Jenkins trend graph? Our build with Jenkins Gatling plugin only shows the trend for the global information in the graph and we want to see the trend per request type as this gives us much more information. Is this possible?

I was looking at the description on their site and it mentions you can configure assertions but to me it wasn't clear if that covers this use case and I'm not finding the assertion files when I run the build with the flag -Dgatling.useOldJenkinsJUnitSupport=true.

To clarify I want the transactions highlighted below in the blue square to appear in the Jenkins graph that shows the trend

Gatling Report enter image description here


Solution

  • I got it working using a workaround. The gatling plugin graph will show a trend per simulation. It is looking for /{simulation-name}/global_stats.json in the /build folder.

    I wrote a groovy script to parse the json data from stats.json. The structure in stats.json is the same as in global_stats.json. So simply parse the stats.json and copy the json.contents[scenario].stats to a separate file in the build folder:

    stats.json structure:

    {
      ...
      "contents": {
        "scenarioName": { 
           stats: {...}  // copy this part
        }
      } 
    

    scenario-report/global_stats.json

    Note the dash "-" in the folder name is required as the plugin is searching for this dash to determine the simulation name. It will nullpointer without it.