The standard configuration of a Magento Cloud project already includes a sample
.blackfire.yaml file at the root of your code directory.
Please first check if this file exists.
- If it does, you can skip the following and proceed to step 7 of the configuration guide
- If it does not, please follow the procedure below.
Writing your first tests
- Create a new Git branch on your Magento Cloud integration platform
- Add a
.blackfire.yamlfile at the root of your code directory
- Write tests, scenarios and metrics (if needed) in that file.
- Commit and push in order to trigger Magento Cloud to deploy an integration environment. You should already see your tests executed on that environment
- Merge the branch to master so that your tests can be applied to any new branch, and deployed in production
If you're wondering which tests to write, here's an example below:
Pages should be fast enough:
- main.wall_time < 400ms
- main.io < 150ms
- main.cpu_time < 300ms
Pages should not consume too much memory:
- main.memory < 50M
- main.peak_memory < 75M
Pages should not do too many SQL queries:
- metrics.sql.queries.count <= 12
Pages should be light:
- metrics.output.network_out < 100KB
Pages should not become slower:
- percent(main.wall_time) < 40%
- diff(metrics.sql.queries.count) < 2