Esempio n. 1
0
 * This source file is subject to the Open Software License (OSL 3.0)
 * that is bundled with this package in the file LICENSE.txt.
 * It is also available through the world-wide-web at this URL:
 * http://opensource.org/licenses/osl-3.0.php
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@magentocommerce.com so we can send you a copy immediately.
 *
 * DISCLAIMER
 *
 * Do not edit or add to this file if you wish to upgrade Magento to newer
 * versions in the future. If you wish to customize Magento for your
 * needs please refer to http://www.magentocommerce.com for more information.
 *
 * @copyright   Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com)
 * @license     http://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0)
 */
$timer = new Magento_Profiler_Driver_Standard_Stat();
$timer->start('root', 0.01, 50000, 1000);
$timer->start('root->init', 0.02, 55000, 1400);
$timer->start('root->init->init_store', 0.02, 55000, 1400);
$timer->stop('root->init->init_store', 0.03, 56000, 1450);
$timer->start('root->init->init_store', 0.02, 56500, 1550);
$timer->stop('root->init->init_store', 0.03, 57500, 1600);
$timer->stop('root->init', 0.06, 57500, 1600);
$timer->stop('root', 0.09, 100000, 2000);
$timer->start('system', 0.11, 50000, 1000);
$timer->stop('system', 0.13, 60000, 1200);
$timer->start('system', 0.14, 50000, 1000);
$timer->stop('system', 0.15, 60000, 1200);
return $timer;
Esempio n. 2
0
 /**
  * Retrieve the list of timer ids from timer statistics object.
  *
  * Timer ids will be ordered and filtered by thresholds and filter pattern.
  *
  * @param Magento_Profiler_Driver_Standard_Stat $stat
  * @return array
  */
 protected function _getTimerIds(Magento_Profiler_Driver_Standard_Stat $stat)
 {
     return $stat->getFilteredTimerIds($this->_thresholds, $this->_filterPattern);
 }
Esempio n. 3
0
 /**
  * Test stop method
  */
 public function testStop()
 {
     $this->_stat->expects($this->once())->method('stop')->with('timer_id', $this->greaterThanOrEqual(microtime(true)), $this->greaterThanOrEqual(0), $this->greaterThanOrEqual(0));
     $this->_driver->stop('timer_id');
 }
Esempio n. 4
0
 /**
  * Stop recording statistics for specified timer.
  *
  * @param string $timerId
  */
 public function stop($timerId)
 {
     $this->_stat->stop($timerId, microtime(true), memory_get_usage(true), memory_get_usage());
 }