Chinya
Chinya

Reputation: 429

How to test the page loading time with Gatling

For example- I need to check that for 1000 users it responds in 3 seconds.

Is the number of users and response times configurable?

Upvotes: 1

Views: 2503

Answers (1)

Pierre DAL-PRA
Pierre DAL-PRA

Reputation: 966

This answer targets Gatling 2.

You can set the target number of users by configuring the "injection profile" of your simulation:

setUp(scn.inject(atOnceUsers(1000)) // To start all users at the same time
setUp(scn.inject(rampUsers(1000) over (30 seconds) // To start gradually, over 30 seconds

For more information, please refer to the injection DSL documentation

If you want to check that all your users responds in less than 3 seconds, one way to ensure this is Gatling's assertions:

setUp(...).assertions(global.responseTime.max.lessThan(3000))

If this assertion fails, meaning at least one user responded in more than 3 seconds, Gatling will clearly indicate the failure after your simulation is completed.

Upvotes: 6

Related Questions