本文整理汇总了PHP中Symfony\Component\HttpKernel\KernelInterface::getStartTime方法的典型用法代码示例。如果您正苦于以下问题:PHP KernelInterface::getStartTime方法的具体用法?PHP KernelInterface::getStartTime怎么用?PHP KernelInterface::getStartTime使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Symfony\Component\HttpKernel\KernelInterface
的用法示例。
在下文中一共展示了KernelInterface::getStartTime方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: collect
/**
* {@inheritdoc}
*/
public function collect(Request $request, Response $response, \Exception $exception = null)
{
$queryCount = 0;
$queryTime = 0;
$dataSources = array();
foreach ($this->dataProfilerManager as $profiler) {
$queryCount += $profiler->count();
$queryTime += $profiler->getTotalElapsedSecs();
$name = $profiler->getDataSourceName();
$dataSources[$name] = array("queryTime" => $profiler->getTotalElapsedSecs(), "queryCount" => $profiler->count(), "profiles" => array());
foreach ($profiler as $profile) {
$dataSources[$name]["profiles"][] = array("queryTime" => $profile->hasEnded() ? $profile->getElapsedSecs() : false, "queryText" => $profiler->getFormatter()->formatHtml($profile->getQueryText()), "params" => $this->formatQueryParams($profile->getQueryParams()), "startTime" => $profile->getStartMicrotime() - $this->kernel->getStartTime(), "endTime" => $profile->hasEnded() ? $profile->getEndMicrotime() - $this->kernel->getStartTime() : false, "startMemoryUsage" => $profile->getStartMemoryUsage(true), "endMemoryUsage" => $profile->hasEnded() ? $profile->getEndMemoryUsage(true) : false, "startPeakMemoryUsage" => $profile->getStartPeakMemoryUsage(true), "endPeakMemoryUsage" => $profile->hasEnded() ? $profile->getEndPeakMemoryUsage(true) : false);
}
}
$this->data["queryCount"] = $queryCount;
$this->data["queryTime"] = $queryTime;
$this->data["dataSources"] = $dataSources;
}
示例2: getStartTime
/**
* {@inheritdoc}
*/
public function getStartTime()
{
return $this->kernel->getStartTime();
}
示例3: __construct
/**
* @param LoggerInterface $logger
* @param QueryExecution $queryExecution
* @param KernelInterface $kernel
*/
public function __construct(LoggerInterface $logger, QueryExecution $queryExecution, KernelInterface $kernel)
{
$this->logger = $logger;
$this->queryExecution = $queryExecution;
$this->startTime = $kernel->getStartTime();
}