添加记录聚合相应时间以及程序执行时间

hotfix/远程访问多媒体中心
cyc 8 years ago
parent 839ef95e6b
commit bd6bfd4028

@ -5,7 +5,8 @@ if (!defined('BASEPATH'))
class search extends CI_Controller{
public function __construct(){
parent::__construct();
parent::__construct();
$this->start_time = microtime(true);
$this->load->model("BIZ_train_model");//加载模型
$this->load->model("BIZ_intel_train_model");//国际火车模型
}
@ -29,16 +30,26 @@ class search extends CI_Controller{
exit('toStation:参数错误!');
}
$api_start_time = microtime(true);
//调用查询模块
$search_return = $this->Searchtrain($train_date,$fromStation,$toStation);
$api_end_time = microtime(true);
//调用数据处理模块
$returnJson = $this->dataOperate($search_return,$fromStation,$toStation);
//调用拼接处理模块
$trainjson = $this->createTrainJson($returnJson);
$end_time = microtime(true);
//聚合接口相应时间
$api_responsive_time = $api_end_time - $api_start_time;
//我们的接口相应时间
$responsive_time = $end_time - $this->start_time;
log_message('error','TRAINSPEED 聚合相应时间:'.$api_responsive_time.'s|接口运行时间:'.$responsive_time.'s');
print_r($trainjson);
}
}

Loading…
Cancel
Save