L
L
Lomoson2014-01-09 15:05:20
Yii
Lomoson, 2014-01-09 15:05:20

How to get the number of database requests in Yii?

Yii::app()->db->getStats() does not return the number of queries like Yii::app()->db->createCommand(), only the number of queries like Model::model()- is counted >findAllByAttribute().
Can you please tell me how can I find out the total number of requests?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
K
Konstantin, 2014-01-09
@Lomoson

Do you need to know the command or is the debugger suitable?
In this case https://github.com/malyshev/yii-debug-toolbar

M
Mikhail Shatilov, 2014-01-09
@iproger

If I did not know how to do it, I would find the root method for sending a request and put the counter there, for example, in a file. I would count the requests and remove the extra code back.

M
Maxim, 2014-01-09
@traestan

It may be worth turning on logging of everything, for example, CProfileLogRoute will show requests and the form Yii::app()->db->createCommand().

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question