In order to benchmark the performances of the backoffice of your shop, you will use the Gatling testing tool.
Note: Backoffice benchmark is only possible starting with prestashop 220.127.116.11!
If you want still want to run the test for version < 18.104.22.168, take a look at this PR: https://github.com/PrestaShop/PrestaShop/pull/8876
Gatling is a stress tool. Development is currently focusing on HTTP support. We won’t explain here the fundamentals of Gatling, but for more details I suggest you to have a look at the Gatling project. Download Gatling from here, and in the same way have a look at the Gatling quickstart page.
Once unzipping the folder it will look like as shown below:
Now let’s test if our Gatling works well, so you can launch a sample test included natively in the project with the CLI:
And choose the simulation you want to run
In my example I run “ basic.BasicExempleSimulation”
After few minutes you can consult the detailed report generated automatically into “results” folder.
Download the script “parcoursbackoffice.scala” and put it under “/gatling/user-files/simulations”.
Open with your editor the parcoursbackoffice.scala file and setup your script:
To avoid handling the multiple generated token on each back-office page, you can just disable it by following the steps below:
Setup environnement TOKEN variable to “disabled” allows you to disable token in urls for Symfony pages and in legacy pages. If you want to test it you need to setup environment variable (SetEnv TOKEN disabled in apache vhost configuration file) and check that Symfony pages (Product, Module, …) urls doesn’t contains _token anymore and legacy pages shouldn’t contains token parameter.
For example if you site is setup in /etc/apache2/sites-enabled/000-default.conf
add the value «SetEnv TOKEN disabled» before < /VirtualHost >
Note: don’t forget to restart your apache service! Now the token are disabled on your PrestaShop site Back-office, this mean that everyone who can log-in your Back-office could access to anypage from the url page. That why we recommend you to run the benchmark on a website only dedicated to test. If this is not the case, don’t forget to restore it when you finish your performance test.