xhprof_enable(XHPROF_FLAGS_CPU + XHPROF_FLAGS_MEMORY); // run some code $kernel->terminate($request, $response); $xhprof_data = xhprof_disable(); $XHPROF_ROOT = "/usr/share/php"; 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"); results can be accessed at http://xhprof.mydevdomain.dev/ m0ar info http://www.jeffgeerling.com/blog/2016/poor-mans-xhprof-profiling-drupal-8-migrations-and-drush-commands