简体   繁体   English

监视Codeigniter应用程序中的查询

[英]monitor queries in codeigniter application

i have been working on CakePhp so far recently switched to CodeIgniter. 到目前为止,我一直在研究CakePhp,最近切换到了CodeIgniter。 I have a CodIgniter project which has come for performance optmization. 我有一个CodIgniter项目,用于性能优化。 I need to check the queries which are taking time and enhance it. 我需要检查需要时间的查询并加以改进。 I want to monitor the time taken by the queries residing in the application. 我想监视驻留在应用程序中的查询所花费的时间。 I am looking for something familiar to what we have in CakePhp which we use to see each query taking how much time in debug mode. 我正在寻找与CakePhp相似的东西,我们可以用来查看每个查询在调试模式下花费多少时间。 I want something like that for codeigniter. 我想要像这样的东西作为codeigniter。 Please help. 请帮忙。

在控制器构造函数中编写以下行:

$this->output->enable_profiler(true);

place the code in your construct function in the controller 将代码放在控制器的构造函数中

$this->output->enable_profiler(true);

it will give you all the query time. 它将为您提供所有查询时间。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM