Beispiel #1
0
 public function testAgentStopTrigger()
 {
     $report = $this->getMock('Telltale\\Report\\ReportInterface');
     $agent = $this->getMock('Telltale\\Agent\\AgentInterface');
     $agent->expects($this->once())->method('analyse')->will($this->returnValue($report));
     $telltale = new Telltale();
     $telltale->pushAgent($agent);
     $telltale->start();
     $telltale->stop();
 }
Beispiel #2
0
<?php

use Telltale\Telltale;
use Telltale\Agent\MemoryPeakAgent;
use Telltale\Agent\CriticalPathAgent;
use Telltale\Agent\SlowestCallsAgent;
use Telltale\Agent\MemoryUsageCallsAgent;
ini_set('error_reporting', E_ALL);
ini_set('display_errors', 1);
ini_set('date.timezone', 'UTC');
// output buffer must be turned on
ob_start();
// autoload
require dirname(dirname(dirname(__FILE__))) . '/vendor/autoload.php';
// setup
$telltale = new Telltale();
$telltale->pushAgent(new MemoryPeakAgent());
$telltale->pushAgent(new CriticalPathAgent());
$telltale->pushAgent(new SlowestCallsAgent());
$telltale->pushAgent(new MemoryUsageCallsAgent());
$telltale->start();
// ----- some functions
function ret_ord($c)
{
    return ord($c);
}
foreach (str_split('Telltale') as $char) {
    ret_ord($char);
}
// ----- recursive calls
function factorial($x)