本文整理汇总了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();
}