A
A
andrei242017-05-30 20:30:24
API
andrei24, 2017-05-30 20:30:24

Analyze query execution time?

There is a backend (api) on laravel. Requests for get, put take 100ms on average, and for some reason 300-1000ms for post.
How to analyze code execution, which processing takes the most time?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
D3lphi, 2017-05-30
@andrei24

1) Use a profiler like xdebug. As a result, we get detailed information about the execution of all calls in the code. Then, using some tool, we view this information in a readable format.
2) Install the Laravel debugbar package . You will get a debug panel, which will display the time spent loading the framework and executing the code itself, the time spent executing database queries. Also, you can measure the execution time of the functions you are interested in in this way:

Debugbar::startMeasure('example', 'Time for example code');
// код, который нужно проанализировать
Debugbar::stopMeasure('example');

R
RidgeA, 2017-05-30
@RidgeA

https://habrahabr.ru/post/129042/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question