laravel、ボトルネック 調査
課題
- ボトルネック の箇所を特定したい
対処
index.php
に以下を埋め込む
define('LARAVEL_START', microtime(true));
- 速度を測定したいコントローラ に以下のようにlogを仕込む。
$to_controller = microtime(true) - LARAVEL_START; Log::info("コントローラに来るまで:".$to_controller); //測定したい処理 $time = microtime(true) - $time_start; Log::info("測定したい処理:".$time);