More Related Content
Similar to FuelPHPで3種のprofilerを使ってみた (20)
FuelPHPで3種のprofilerを使ってみた
- 3. 自己紹介
• 名前:三浦 克浩
• Twitter ID:@MiuraKatsu
• 仕事:ソーシャルゲーム開発
• 好きなフレームワーク:
CakePHP、Yacafi
• 浦和レッズ:
13年9月14日土曜日
- 25. 対応フレームワーク
• CakePHP 1.2, 1.3, and 2.*
• CodeIgniter 2
• Drupal 6 and 7
• Joomla 1.5 and 1.6
• Kohana 3.2 and 3.3
• Magento 1.5 and 1.6
• MediaWiki
• QDrupal
• Symfony 1
• WordPress
• Yii
• Zend Framework 1
13年9月14日土曜日
- 31. index.php
try
{
//$response = Request::forge()->execute()->response();
$request = Request::forge();
$response = $request->execute()->response();
//New Relic対応
if (extension_loaded ('newrelic'))
{
$segments = $request->uri->get_segments();
$newrelic_controller = isset($segments[1]) ? $segments[1] : null;
$newrelic_action = isset($segments[2]) ? $segments[2] : null;
$newrelic_params = isset($segments[3]) ? $segments[3] : null;
newrelic_name_transaction (
$newrelic_controller . '/' .
$newrelic_action . '/' .
$newrelic_params);
}
}
13年9月14日土曜日
- 50. index.php
// Boot the app
require APPPATH.'bootstrap.php';
if(function_exists('xhprof_disable'))
{
register_shutdown_function( function()
{
$xhprof_data = xhprof_disable();
$XHPROF_ROOT = '/var/www/xhprof/'; //xhprofをインストールしたディレクトリ
$XHPROF_SOURCE_NAME = 'fuelphp';
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('/tmp');
$run_id = $xhprof_runs->save_run($xhprof_data, $XHPROF_SOURCE_NAME);
echo "<a href="http://".$_SERVER["SERVER_ADDR"]."/xhprof_html/index.php?run=
$run_id&source=$XHPROF_SOURCE_NAME">xhprof Result</a>n";
});
}
bootstrap.phpの後で
register_shutdown_function()
13年9月14日土曜日
- 54. ログになら
Log::debug("[" . $_SERVER['REQUEST_URI'] . "] -> http://".
$_SERVER["SERVER_ADDR"]."/xhprof_html/index.php?run=$run_id&source=
$XHPROF_SOURCE_NAME");
echo "<a href="http://".$_SERVER["SERVER_ADDR"]."/xhprof_html/index.php?
run=$run_id&source=$XHPROF_SOURCE_NAME">xhprof Result</a>n";
13年9月14日土曜日
- 74. こんな感じ
INFO - 2013-09-08 18:28:19 --> FuelCoreRequest::__construct - Creating a new Request with URI =
"welcome/index"
INFO - 2013-09-08 18:28:19 --> FuelCoreRequest::execute - Called
INFO - 2013-09-08 18:28:19 --> FuelCoreRequest::execute - Setting main Request
DEBUG - 2013-09-08 18:28:19 --> Array
(
[session_id] => ce1d264276ff7a28bf33883bf69d173a
[output_data] => Array
(
[logs] => Array
(
[console] => Array
(
[0] => Array
(
[data] => 46.040 ms
[type] => speed
[name] => FuelCoreProfiler::init Start
)
[1] => Array
(
[data] => 67.952 ms
[type] => speed
[name] => FuelCoreFuel::init End
)
[2] => Array
13年9月14日土曜日