Note on package levels

Depending on your Magento Cloud package, you may have been granted a
Blackfire Enterprise for Magento Cloud Enterprise or a Blackfire Premium for Magento Cloud Enterprise access.

If you are on Premium, the following does not apply as you cannot work with the .blackfire.yml  file. 

Please check with your Magento Cloud account manager if you're not sure which level you are entitled to.

Writing your first tests

  1. Create a new Git branch on your Magento Cloud integration platform
  2. Add a .blackfire.yml  file at the root of your code directory
  3. Write tests, scenarios and metrics (if needed) in that file.
  4. Commit and push in order to trigger Magento Cloud to deploy an integration environment. You should already see your tests executed on that environment
  5. 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:

tests:      
    Pages should be fast enough:
        path: /.*
        assertions:
            - main.wall_time < 400ms
            - main.io < 150ms
            - main.cpu_time < 300ms
    Pages should not consume too much memory:
        path: /.*
        assertions:
            - main.memory < 50M
            - main.peak_memory < 75M
    Pages should not do too many SQL queries:
        path: /.*
        assertions:
            - metrics.sql.queries.count <= 12
    Pages should be light:
        path: /.*
        assertions:
            - metrics.output.network_out < 100KB
    Pages should not become slower:
        path: /.*
        assertions:
            - percent(main.wall_time) < 40%
            - diff(metrics.sql.queries.count) < 2
scenarios:
    Home:
        - /
    Product list:
        - /women/tops-women/jackets-women.html
    Checkout:
        - /checkout
    Payment:
        - /checkout/payment
Did this answer your question?