「Php/速度改善/tideways xhprof」の版間の差分
提供: 初心者エンジニアの簡易メモ
(→サンプル) |
|||
| 行25: | 行25: | ||
$data = xhprof_disable(); | $data = xhprof_disable(); | ||
| − | var_dump($data); | + | var_dump($data); |
</pre> | </pre> | ||
| + | array(3) { ["main()==>usleep"]=> array(2) { ["ct"]=> int(1) ["wt"]=> int(100109) } ["main()==>xhprof_disable"]=> array(2) { ["ct"]=> int(1) ["wt"]=> int(0) } ["main()"]=> array(2) { ["ct"]=> int(1) ["wt"]=> int(100125) } } | ||
2026年4月17日 (金) 04:32時点における版
インストール(php8の場合)
dnf install -y php-devel php-pear gcc make pecl install tideways_xhprof
php.ini設定
echo "extension=xhprof.so" > /etc/php.d/50-xhprof.ini
確認
$ php -m | grep xhprof xhprof
サンプル
<?php xhprof_enable(); // 適当な処理 usleep(100000); $data = xhprof_disable(); var_dump($data);
array(3) { ["main()==>usleep"]=> array(2) { ["ct"]=> int(1) ["wt"]=> int(100109) } ["main()==>xhprof_disable"]=> array(2) { ["ct"]=> int(1) ["wt"]=> int(0) } ["main()"]=> array(2) { ["ct"]=> int(1) ["wt"]=> int(100125) } }
