title: How to find bottleneck in Laravel?
body: <p>I have a large application written using Laravel 5.2. The application seems to be running good for a while "day or two" and then it starts slowing down "each request table 15+ seconds."</p>
  
  <p>I am trying to figure out what could be causing the speed degrade. To get started, I listed the top 4 categories "below" that I should review in order.</p>
  
  <ol>
  <li>SQL Server problems. Locks, long running queries.</li>
  <li>PHP problem which could be causing extra/not needed work like long running loops</li>
  <li>Web Server Issues like memory leaks or slow response time.</li>
  <li>Network Issues.</li>
  </ol>
  
  <p>For the first category "i.e. SQL Problems" I evaluated all of the queries and everything seems to be light and fairly fast. There are no long running queries, and I find no SQL locks. Although I did not eliminate this as a possible issue, but for now it is fair to look elsewhere. One thing to note that the application is generating lots of queries which suggests that I may be running into the N+1 case.</p>
  
  <p>While categories 3 and 4 are important, I like to focus some time on the second category "i.e. Code problem" which is where I need help. I need to be able to figure out couple of things to help me make an educated judgement if there is an code issue or not. Here are few thing that I like to know/start logging.</p>
  
  <ol>
  <li>How long each class takes to execute to see if one takes longer time to run.</li>
  <li>How many/list of all queries that being generated from each class where I can identify the source of the N+1 case.</li>
  </ol>
  
  <p>I am using Clockwork extension in Google Chrome which is helping me a log. But, I am unable to break down the result at the class level which will give me a deep understanding of what is going on.</p>
  
  <p>How can gather the 2 items listed above? Is it possible to hook into Clockwork and add that info as a filter to it where I just see all that into Google Extension?</p>