Skip to content
Browse files

removed the id set and it currently is null, doctrine will generate a…

…nd then I will assign it to ->runId
  • Loading branch information...
1 parent 91e4834 commit 26044814ab21f1b3e479b7c20a5ccbf1cc643819 @dcsg dcsg committed Oct 15, 2012
Showing with 7 additions and 9 deletions.
  1. +7 −9 DataCollector/XhprofCollector.php
View
16 DataCollector/XhprofCollector.php
@@ -58,13 +58,11 @@ public function startProfiling()
if (false !== strpos($_SERVER['REQUEST_URI'], "_wdt") || false !== strpos($_SERVER['REQUEST_URI'], "_profiler")) {
$this->profiling = false;
-
return;
}
if (mt_rand(1, $this->container->getParameter('jns_xhprof.sample_size')) != 1) {
$this->profiling = false;
-
return;
}
@@ -125,26 +123,26 @@ private function saveProfilingDataToDB($xhprof_data)
}
$em = $this->doctrine->getEntityManager($this->container->getParameter('jns_xhprof.entity_manager'));
-
$xhprofDetail = new XhprofDetail();
$xhprofDetail
- ->setId($this->runId)
->setUrl($url)
->setCanonicalUrl($this->getCanonicalUrl($url))
->setServerName($sname)
- ->setPerfData(gzcompress(json_encode($xhprof_data), 2))
- ->setCookie(json_encode($_COOKIE))
- ->setPost(json_encode($_POST))
- ->setGet(json_encode($_GET))
+ ->setPerfData(gzcompress(serialize(($xhprof_data))))
+ ->setCookie(serialize($_COOKIE))
+ ->setPost(serialize($_POST))
+ ->setGet(serialize($_GET))
->setPmu($pmu)
->setWt($wt)
->setCpu($cpu)
- ->setServerId(getenv('SERV_NAME'))
+ ->setServerId(getenv('SERVER_NAME'))
->setAggregateCallsInclude('')
;
$em->persist($xhprofDetail);
$em->flush();
+
+ $this->runId = $xhprofDetail->getId();
}
/**

0 comments on commit 2604481

Please sign in to comment.
Something went wrong with that request. Please try again.