2017 © Pedro Peláez
 

library xhprof-collector

Simple library that wraps Xhprof profile collection.

image

qafoolabs/xhprof-collector

Simple library that wraps Xhprof profile collection.

  • Sunday, June 8, 2014
  • by beberlei
  • Repository
  • 4 Watchers
  • 10 Stars
  • 910 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

Xhprof Collector

Wrapper around Xhprof API., (*1)

<?php
$profiler = new \Xhprof\ProfileCollector(
    new \Xhprof\FacebookBackend('/tmp', 'myapp'),
    new \Xhprof\StartDecisions\AlwaysStart()
);

$profiler->start();

// now all your application code here

$profiler->stop("name of operation that was performed");

Symfony Integration Example

<?php

use Symfony\Component\HttpFoundation\Request;

require_once __DIR__ . "/../vendor/autoload.php";
require_once __DIR__ . "/../app/AppKernel.php";

$profiler = new \Xhprof\ProfileCollector(
    new \Xhprof\FacebookBackend('/tmp', 'myapp'),
    new \Xhprof\StartDecisions\AlwaysStart()
);
$profiler->start();

$request = Request::createFromGlobals();
$kernel = AppKernel::createFromBuildProperties();

$response = $kernel->handle($request);
$response->send();

$kernel->terminate($request, $response);

$profiler->stop($request->attributes->get('_controller', 'notfound'));

The Versions

08/06 2014

dev-master

9999999-dev

Simple library that wraps Xhprof profile collection.

  Sources   Download

MIT

The Development Requires

25/05 2014

v0.1

0.1.0.0

Simple library that wraps Xhprof profile collection.

  Sources   Download

MIT

The Development Requires