Skip to content

Instantly share code, notes, and snippets.

@ajardin
Created August 21, 2020 18:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ajardin/4f47890851d284748f1cf7ac0dbeff96 to your computer and use it in GitHub Desktop.
Save ajardin/4f47890851d284748f1cf7ac0dbeff96 to your computer and use it in GitHub Desktop.
Blackfire & Magento
- <a href="<?php echo $helper->getCategoryUrl($category); ?>">
+ <a href="<?php echo $helper->getData('url_path'); ?>">
<?php echo $category->getData('name'); ?>
</a>
tests:
Pages should be fast enough:
path: "/.*"
assertions:
- "main.wall_time < 3s"
- "main.io < 1s"
- "main.cpu_time < 2s"
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 < 100"
Checkout pages should be light:
path: "/checkout/.*"
assertions:
- "metrics.output.network_out < 200KB"
metrics:
catalog.getCategoryUrl:
label: "getCategoryUrl() calls"
matching_calls:
php:
- callee: '=PROJECT_MODULE_CLASS::getCategoryUrl'
tests:
"Ensure that getCategoryUrl() calls do not occur too many times":
path: "/.*"
assertions:
- "metrics.catalog.getCategoryUrl.count < 10"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment