Skip to content

Instantly share code, notes, and snippets.

@emersonmx
Last active January 18, 2017 14:15
Show Gist options
  • Save emersonmx/940e401c4dc7509c0a01 to your computer and use it in GitHub Desktop.
Save emersonmx/940e401c4dc7509c0a01 to your computer and use it in GitHub Desktop.
<?php
xhprof_enable(XHPROF_FLAGS_CPU + XHPROF_FLAGS_MEMORY);
// The POG goes here
$xhprof_data = xhprof_disable();
$XHPROF_ROOT = "./xhprof";
include_once $XHPROF_ROOT . "/xhprof_lib/utils/xhprof_lib.php";
include_once $XHPROF_ROOT . "/xhprof_lib/utils/xhprof_runs.php";
$xhprof_runs = new XHProfRuns_Default();
$run_id = $xhprof_runs->save_run($xhprof_data, "xhprof_testing");
echo "http://{$_SERVER['HTTP_HOST']}/xhprof/xhprof_html/index.php?run={$run_id}&source=xhprof_testing\n";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment