</body>
</html>

<?php 
require dirname(dirname(__DIR__)) . '/vendor/autoload.php';
require __DIR__ . '/DataCollector/User.php';
require __DIR__ . '/DataCollector/Request.php';
$profiler = new \Fabfuel\Prophiler\Profiler();
$logger = new \Fabfuel\Prophiler\Adapter\Psr\Log\Logger($profiler);
$multiplicator = 20;
$wait = function ($time) use($multiplicator) {
    return $time * rand($multiplicator * 0.8, $multiplicator * 1.2);
};
$bootstrap = $profiler->start('Bootstrap', ['lorem' => 'ipsum'], 'Application');
usleep($wait(50));
$profiler->stop($bootstrap);
$logger->info('Bootstrap has finished', ['some' => 'context']);
$bootstrap = $profiler->start('Session::load', ['lorem' => 'ipsum'], 'Sessions');
usleep($wait(45));
$profiler->stop($bootstrap);
$dispatcher = $profiler->start('Dispatcher', ['abc' => '123', 'foobar' => true], 'Dispatcher');
usleep($wait(25));
$logger->warning('Not everything ready to go', ['some' => 'context']);
$router = $profiler->start('Router', ['some' => 'value', 'foobar' => 123], 'Dispatcher');
usleep($wait(150));
$profiler->stop($router);
$logger->alert('Route could not be found');
$controller = $profiler->start('Controller', ['some' => 'value', 'foobar' => 123, 'array' => ['foo' => 'bar', 'lorem' => true, 'ipsum' => 1.5]], 'Application');
usleep($wait(200));
$view = $profiler->start('View::render', ['data' => ['user' => ['name' => 'John Doe', 'age' => 26]], 'foobar' => 123], 'View');
usleep($wait(10));