The "Number of concurrent users" chart is displaying incorrectly

Gatling version: 3.14.9, 3.15.0, 3.15.1
Gatling flavor: java kotlin scala javascript typescript
Gatling build tool: maven gradle sbt bundle npm

I made sure I’ve update my Gatling version to the latest release
I read the guidelines and how to ask a question topics.
I provided a SSCCE (or at least, all information to help the community understand my topic)
I copied output I observe, and explain what I think should be.

The display of the “Number of concurrent users” chart looks incorrect.
Unless I am misinterpreting the chart, it appears to be a bug.

As you can see if you check what I tried—

—unlike in that case, I am not using asLongAs or similar constructs.

I tried the following steps with each of the items listed below,
but the results were the same in every case:
・gatling-charts-highcharts-bundle-3.14.9.1-bundle.zip (Gatling 3.14.9)
・gatling-maven-plugin-demo-java-main.zip (Gatling 3.15.0)
・gatling-maven-plugin-demo-java-main.zip (pom.xml edited to use Gatling 3.15.1)

■ Issue 1
I executed the included src\test\java\example\BasicSimulation.java exactly as is.
Below is an excerpt of the scenario definition and setUp configuration:

private static final ScenarioBuilder scenario = scenario(“Scenario”).exec(http(“Session”).get(“/session”));

private static final int vu = Integer.getInteger(“vu”, 1);
setUp(scenario.injectOpen(atOnceUsers(vu))).assertions(assertion).protocols(httpProtocol);

In the “Number of concurrent users” chart of the generated HTML report,
the values ​​for “Scenario” and “All users” are both 1 at the end of the simulation.
Since the users have finished the scenario, I believe the correct value for both should be 0.

■ Issue 2
I modified the scenario definition and setUp in BasicSimulation.java as follows and executed it:

private static final ScenarioBuilder scenario1 = scenario(“Scenario1”).exec(http(“Session”).get(“/session”));
private static final ScenarioBuilder scenario2 = scenario(“Scenario2”).exec(http(“Session”).get(“/session”));
private static final ScenarioBuilder scenario3 = scenario(“Scenario3”).exec(http(“Session”).get(“/session”));

setUp(
  scenario1.injectOpen(rampUsers(10).during(100), nothingFor(50), rampUsers(10).during(100)),
  scenario2.injectOpen(rampUsers(10).during(100)),
  scenario3.injectOpen(nothingFor(150), rampUsers(10).during(100))
).assertions(assertion).protocols(httpProtocol);

In the “Number of concurrent users” chart of the generated HTML report, the following points appear incorrect:
・For Scenario 2, although all users have finished the scenario approximately 100 seconds after the simulation starts,
the value remains at 1 until the end of the simulation.
*In contrast, for Scenario 1—which uses the same rampUsers(10).during(100) setting—the value drops to 0 after about 100 seconds.
・At the end of the simulation, the values ​​for Scenarios 1 through 3 are 1 each (totaling 3),
yet the value for “All users” is 2. However, since the users for all scenarios have finished, I believe 0 is the correct value for Scenario 1 through Scenario 3 and “All users.”

All metrics are computed over buckets, whose width depends on the test duration.
In Gatling Enterprise, the bucket width is the “resolution” that visible on the reports page.

Concurrent users actually means “maximum number of concurrent users at any point in time during a given bucket”.

As a result:

  • the value in the last bucket is not 0. It would be 0 for the bucket after the last one (but it’s not displayed)
  • the value for “all scenarios” is not necessarily the sum of the values for each scenario, depending on how your virtual users are spawned and terminate.

I see.
I understand now that because there are times when the user count in the bucket is 0 and times when it is 1, the final values ​​for Scenario 1, Scenario 3, and “all Users” at the end of the simulation are not 0.

However, regarding Scenario 2, the last user finishes immediately after sending a single request at the 100-second mark. Shouldn’t the maximum bucket value drop to 0 for the period between 100 seconds and the end of the simulation?
Why does the value remain at 1 until the simulation ends?

No scenarios are executed between 100 and 150 seconds,
and only Scenario 1 and Scenario 3 run from the 150-second mark onwards.

This one was indeed a bug, thanks for reporting!
Fixed, cf Reports: concurrent users last value might not be updated · Issue #4697 · gatling/gatling · GitHub