當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。