Skip to content

Instantly share code, notes, and snippets.

@miukoba
Created December 12, 2013 08:37
Show Gist options
  • Save miukoba/7924900 to your computer and use it in GitHub Desktop.
Save miukoba/7924900 to your computer and use it in GitHub Desktop.
xhprof の設定
<?php
// フロントコントローラとかに仕込む
xhprof_enable();
// 処理
$xhprof_data = xhprof_disable();
$XHPROF_ROOT = '/var/www/xhprof';
$XHPROF_SOURCE_NAME = 'symfony';
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_SOURCE_NAME);
// echo "\n\n-----------------\n<a href='http://mydomain.com/xhprof/xhprof_html/index.php?run=$run_id&source=$XHPROF_SOURCE_NAME' target='_blank'>xhprof Result</a>\n-----------------\n";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment