Exemple #1
0
 protected function setUp()
 {
     parent::setUp();
     $this->datasource = new Memory();
     $this->profiler = new Profiler();
     $this->profiler->setDataSource($this->datasource);
     $this->process = $this->profiler->getContext()->getProcess();
     $this->collector = new Log($this->process, $this->profiler->getDatasource());
     $this->profiler->registerCollector($this->collector);
 }
Exemple #2
0
 public function testAddCollectorClass()
 {
     $this->profiler->registerCollector(new PhpVersion($this->profiler->getContext()->getProcess(), $this->profiler->getDatasource()));
     $this->profiler->registerCollector(new Timeline($this->profiler->getContext()->getProcess(), $this->profiler->getDatasource()));
     $this->profiler->registerCollector(new Duration($this->profiler->getContext()->getProcess(), $this->profiler->getDatasource()));
     $collectors = $this->profiler->getCollectors();
     $this->assertEquals(1, count($collectors['initial']));
     $this->assertEquals(1, count($collectors['final']));
     $this->assertEquals(1, count($collectors['stream']));
 }
Exemple #3
0
 protected function setUp()
 {
     parent::setUp();
     $this->datasource = new Memory();
     $this->profiler = new Profiler();
     $dispatcher = $this->profiler->getContext()->getProcess()->getDispatcher();
     $this->profiler->setTimeline(new TimelineComponent($dispatcher));
     $this->profiler->setDataSource($this->datasource);
     $this->process = $this->profiler->getContext()->getProcess();
     $this->collector = new Timeline($this->process, $this->profiler->getDatasource());
     $this->profiler->registerCollector($this->collector);
 }