当前位置: 首页>>代码示例>>PHP>>正文


PHP Profile::getCollector方法代码示例

本文整理汇总了PHP中Symfony\Component\HttpKernel\Profiler\Profile::getCollector方法的典型用法代码示例。如果您正苦于以下问题:PHP Profile::getCollector方法的具体用法?PHP Profile::getCollector怎么用?PHP Profile::getCollector使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Symfony\Component\HttpKernel\Profiler\Profile的用法示例。


在下文中一共展示了Profile::getCollector方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: savePerformanceTimingAction

 /**
  * @param \Symfony\Component\HttpKernel\Profiler\Profile $profile
  * @param \Symfony\Component\HttpFoundation\Request $request
  *
  * @return \Symfony\Component\HttpFoundation\JsonResponse
  */
 public function savePerformanceTimingAction(Profile $profile, Request $request)
 {
     $this->profiler->disable();
     $data = Json::decode($request->getContent());
     /** @var  $collector */
     $collector = $profile->getCollector('performance_timing');
     $collector->setData($data);
     $this->profiler->updateProfile($profile);
     return new JsonResponse(['success' => TRUE]);
 }
开发者ID:ddrozdik,项目名称:dmaps,代码行数:16,代码来源:ToolbarController.php

示例2: saveStopwatchInfoInProfile

 /**
  * Update the profiles with the timing info and saves them.
  *
  * @param Profile $profile        The root profile
  * @param Boolean $updateChildren Whether to update the children altogether
  */
 private function saveStopwatchInfoInProfile(Profile $profile, $updateChildren)
 {
     $profile->getCollector('time')->setEvents($this->stopwatch->getSectionEvents($profile->getToken()));
     $this->profiler->saveProfile($profile);
     if ($updateChildren) {
         foreach ($profile->getChildren() as $child) {
             $this->saveStopwatchInfoInProfile($child, true);
         }
     }
 }
开发者ID:laubosslink,项目名称:lab,代码行数:16,代码来源:ContainerAwareTraceableEventDispatcher.php

示例3: restCollectorAction

 /**
  * Exposes collector's data as JSON.
  *
  * @param \Symfony\Component\HttpKernel\Profiler\Profile $profile
  * @param $collector
  *
  * @return \Symfony\Component\HttpFoundation\JsonResponse
  */
 public function restCollectorAction(Profile $profile, $collector)
 {
     $this->profiler->disable();
     $data = $profile->getCollector($collector)->getData();
     return new JsonResponse(['data' => $data]);
 }
开发者ID:ABaldwinHunter,项目名称:durhamatletico-cms,代码行数:14,代码来源:DashboardController.php

示例4: saveInfoInProfile

 /**
  * Update the profiles with the timing and events information and saves them.
  *
  * @param Profile $profile        The root profile
  * @param Boolean $updateChildren Whether to update the children altogether
  */
 private function saveInfoInProfile(Profile $profile, $updateChildren)
 {
     try {
         $collector = $profile->getCollector('memory');
         $collector->updateMemoryUsage();
     } catch (\InvalidArgumentException $e) {
     }
     try {
         $collector = $profile->getCollector('time');
         $collector->setEvents($this->stopwatch->getSectionEvents($profile->getToken()));
     } catch (\InvalidArgumentException $e) {
     }
     try {
         $collector = $profile->getCollector('events');
         $collector->setCalledListeners($this->getCalledListeners());
         $collector->setNotCalledListeners($this->getNotCalledListeners());
     } catch (\InvalidArgumentException $e) {
     }
     $this->profiler->saveProfile($profile);
     if ($updateChildren) {
         foreach ($profile->getChildren() as $child) {
             $this->saveInfoInProfile($child, true);
         }
     }
 }
开发者ID:ronnylt,项目名称:symfony,代码行数:31,代码来源:TraceableEventDispatcher.php

示例5: assertHasServiceInDIContainer

 protected function assertHasServiceInDIContainer(Profile $profile, $serviceName, $RequestedService = array("security.context"))
 {
     $logMessages = $profile->getCollector("dependency_injection")->getLogMessages();
     $servicesDI = array();
     if (null !== $logMessages) {
         foreach ($logMessages as $k => $message) {
             if (in_array($message['id'], $RequestedService)) {
                 $servicesDI[] = $message['caller']['method'];
             }
         }
     }
     $this->assertContains($serviceName, implode(array_values($servicesDI)));
 }
开发者ID:pigroupe,项目名称:SfynxAuthBundle,代码行数:13,代码来源:WebTestCase.php

示例6: validateCorsResponseDbCount

 /**
  * @param Profile $profile
  */
 protected function validateCorsResponseDbCount(Profile $profile)
 {
     /** @var DoctrineDataCollector $doctrineDataCollector */
     $doctrineDataCollector = $profile->getCollector('db');
     $this->assertEquals(0, $doctrineDataCollector->getQueryCount());
 }
开发者ID:jlekowski,项目名称:battleships-api,代码行数:9,代码来源:CorsControllerTest.php

示例7: validateGetGamesCore

 /**
  * @param Response $response
  * @param Profile $profile
  */
 protected function validateGetGamesCore(Response $response, Profile $profile)
 {
     $this->assertGetJsonCors($response);
     /** @var DoctrineDataCollector $doctrineDataCollector */
     $doctrineDataCollector = $profile->getCollector('db');
     // SELECT user1, SELECT game, [... SELECT user (available game)]
     $this->assertGreaterThanOrEqual(2, $doctrineDataCollector->getQueryCount());
 }
开发者ID:jlekowski,项目名称:battleships-api,代码行数:12,代码来源:GameControllerTest.php


注:本文中的Symfony\Component\HttpKernel\Profiler\Profile::getCollector方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。