public function actionEcho() { Profiler::begin(__METHOD__); sleep(1); \Yii::info("liuyue test", "value"); Profiler::end(__METHOD__); Profiler::log(__METHOD__); }
public function actionEcho() { Profiler::begin(__METHOD__); sleep(1); util\String::myEcho("hello world"); \Yii::info("liuyue test", "value"); Profiler::end(__METHOD__); Profiler::log(__METHOD__); }
public function afterAction($action, $result) { $key = $this->_getKey($action); Profiler::end($key); $timeCost = Profiler::time($key); Profiler::free($key); list($prefix, $actionInfo) = explode("\$", $key); $logKey = "Action Time Cost"; $logMsg = "[action:{$actionInfo}][time(ms):{$timeCost}]"; \Yii::info($logMsg, $logKey); return $result; }