Skip to content

Instantly share code, notes, and snippets.

@pateketrueke
Created May 22, 2012 21:30
Show Gist options
  • Save pateketrueke/2771730 to your computer and use it in GitHub Desktop.
Save pateketrueke/2771730 to your computer and use it in GitHub Desktop.
XHProf hook example
<?php
call_user_func(function () {
register_shutdown_function(function () {
$data = xhprof_disable();
$obj = new XHProfRuns_Default();
$obj->save_run($data, 'MyApp');
});
require 'xhprof_lib/utils/xhprof_lib.php';
require 'xhprof_lib/utils/xhprof_runs.php';
xhprof_enable(XHPROF_FLAGS_NO_BUILTINS);
// ...
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment