本文整理匯總了PHP中Profiler::__construct方法的典型用法代碼示例。如果您正苦於以下問題:PHP Profiler::__construct方法的具體用法?PHP Profiler::__construct怎麽用?PHP Profiler::__construct使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Profiler
的用法示例。
在下文中一共展示了Profiler::__construct方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: __construct
/**
* @param array $params
* @see Xhprof::__construct()
*/
public function __construct(array $params = [])
{
parent::__construct($params);
$flags = isset($params['flags']) ? $params['flags'] : 0;
$options = isset($params['exclude']) ? ['ignored_functions' => $params['exclude']] : [];
Xhprof::enable($flags, $options);
$this->sprofiler = new SectionProfiler();
}
示例2: array
function __construct($params)
{
global $wgRequestTime, $wgRUstart;
parent::__construct($params);
$this->errorEntry = $this->zeroEntry;
$this->errorEntry['count'] = 1;
if (!empty($wgRequestTime) && !empty($wgRUstart)) {
# Remove the -total entry from parent::__construct
$this->mWorkStack = array();
$this->mWorkStack[] = array('-total', 0, $wgRequestTime, $this->getCpuTime($wgRUstart));
$elapsedcpu = $this->getCpuTime() - $this->getCpuTime($wgRUstart);
$elapsedreal = microtime(true) - $wgRequestTime;
$entry =& $this->mCollated["-setup"];
if (!is_array($entry)) {
$entry = $this->zeroEntry;
$this->mCollated["-setup"] =& $entry;
}
$entry['cpu'] += $elapsedcpu;
$entry['cpu_sq'] += $elapsedcpu * $elapsedcpu;
$entry['real'] += $elapsedreal;
$entry['real_sq'] += $elapsedreal * $elapsedreal;
$entry['count']++;
}
}
示例3: __construct
/**
* @param array $params
* @see Xhprof::__construct()
*/
public function __construct(array $params = array())
{
parent::__construct($params);
$this->xhprof = new Xhprof($params);
$this->sprofiler = new SectionProfiler();
}
示例4: __construct
/**
* @param array $params
*/
public function __construct(array $params)
{
parent::__construct($params);
$this->mCollateOnly = $this->collateOnly();
$this->addInitialStack();
}
示例5: __construct
public function __construct(array $params = [])
{
parent::__construct($params);
$this->sprofiler = new SectionProfiler();
}