Skip to content

Instantly share code, notes, and snippets.

@sta1r
Created July 12, 2019 14:43
Show Gist options
  • Select an option

  • Save sta1r/47ded7a72adb6d4d5f9d5cff6f34ae90 to your computer and use it in GitHub Desktop.

Select an option

Save sta1r/47ded7a72adb6d4d5f9d5cff6f34ae90 to your computer and use it in GitHub Desktop.
M1 database query profiler
$profiler = Mage::getSingleton('core/resource')->getConnection('core_write')->getProfiler();
$profiler->setEnabled(true);
/*
*
*
*
* Code to be analysed
*
*
*
*/
Mage::log(print_r($profiler->getQueryProfiles(), true), null, 'queries.log', true);
$profiler->setEnabled(false);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment