【发布时间】:2014-10-18 06:32:09
【问题描述】:
我正在尝试将其他时间信息添加到 Symfony Profiler Timeline 中,但我无法显示任何内容。根据我阅读的文档,它应该像下面的示例一样简单,但这不会导致任何额外的信息出现在时间轴上。
我是否需要以某种方式让探查器知道我正在开始和停止的事件?
use Symfony\Component\Stopwatch\Stopwatch;
class DefaultController extends Controller
{
public function testAction()
{
$stopwatch = new Stopwatch();
$stopwatch->start('testController');
usleep(1000000);
$response = new Response(
'<body>Hi</body>',
Response::HTTP_OK,
array('content-type' => 'text/html')
);
$event = $stopwatch->stop('testController');
return $response;
}
}
【问题讨论】: