Beispiel #1
0
 /**
  * Render the profiler output.
  *
  * @return  \stdClass
  *
  * @since   1.0
  */
 private function getProfile()
 {
     $points = $this->profiler->getPoints();
     $pointStart = $points[0]->getName();
     $pointEnd = $points[count($points) - 1]->getName();
     $profile = new \stdClass();
     $profile->peak = $this->profiler->getMemoryBytesBetween($pointStart, $pointEnd);
     $profile->time = $this->profiler->getTimeBetween($pointStart, $pointEnd);
     return $profile;
 }
Beispiel #2
0
 /**
  * @covers  \Joomla\Profiler\Profiler::getTimeBetween
  * @uses    \Joomla\Profiler\Profiler::__construct
  *
  * @expectedException \LogicException
  */
 public function testTheProfilerCannotMeasureTimeBetweenTwoPointsIfTheFirstPointDoesNotExist()
 {
     $first = new ProfilePoint('start');
     $profiler = new Profiler('test', null, array($first));
     $profiler->getTimeBetween('foo', 'start');
 }
 /**
  * Tests the getTimeBetween method exception.
  * When the first point doesn't exist.
  *
  * @return  void
  *
  * @covers  \Joomla\Profiler\Profiler::getTimeBetween
  * @expectedException \LogicException
  * @since   1.0
  */
 public function testGetTimeBetweenExceptionFirst()
 {
     $first = new ProfilePoint('start');
     $profiler = new Profiler('test', null, array($first));
     $profiler->getTimeBetween('foo', 'start');
 }