Added profile timers
Track the running time of a function
Profiler::time(function(){});
Profiler::time(function(){}, 'name');
Track a stopwatch style timer throughout your app
Profiler::tick('name');
Profiler::tick('name', function($timer){});
This commit is contained in:
@@ -48,6 +48,52 @@
|
||||
<span class="anbu-empty">There have been no SQL queries executed.</span>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
<div class="anbu-tab-pane anbu-table anbu-checkpoints">
|
||||
@if (count($timers) > 0)
|
||||
<table>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Running Time (ms)</th>
|
||||
<th>Difference</th>
|
||||
</tr>
|
||||
@foreach ($timers as $name => $timer)
|
||||
<tr>
|
||||
<td class="anbu-table-first">
|
||||
{{ $name }}
|
||||
</td>
|
||||
<td><pre>{{ $timer['running_time'] }}ms (time from start to render)</pre></td>
|
||||
<td> </td>
|
||||
</tr>
|
||||
|
||||
@if (isset($timer['ticks']))
|
||||
@foreach( $timer['ticks'] as $tick)
|
||||
<tr>
|
||||
<td>
|
||||
<pre>Tick</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre>{{ $tick['time'] }}ms</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre>+ {{ $tick['diff'] }}ms</pre>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
@else
|
||||
<tr>
|
||||
<td><pre>Running Time</pre></td>
|
||||
<td><pre>{{ $timer['time'] }}ms</pre></td>
|
||||
<td> </td>
|
||||
</tr>
|
||||
@endif
|
||||
|
||||
@endforeach
|
||||
</table>
|
||||
@else
|
||||
<span class="anbu-empty">There have been no checkpoints set.</span>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -61,7 +107,7 @@
|
||||
@endif
|
||||
</a>
|
||||
</li>
|
||||
<li><a class="anbu-tab">Time <span class="anbu-count">{{ $time }}ms</span></a></li>
|
||||
<li><a class="anbu-tab" data-anbu-tab="anbu-checkpoints">Time <span class="anbu-count">{{ $time }}ms</span></a></li>
|
||||
<li><a class="anbu-tab">Memory <span class="anbu-count">{{ $memory }} ({{ $memory_peak }})</span></a></li>
|
||||
<li class="anbu-tab-right"><a id="anbu-hide" href="#">↦</a></li>
|
||||
<li class="anbu-tab-right"><a id="anbu-close" href="#">×</a></li>
|
||||
@@ -75,4 +121,4 @@
|
||||
|
||||
<script>window.jQuery || document.write("<script src='//ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js'>\x3C/script>")</script>
|
||||
<script>{{ file_get_contents(path('sys').'profiling/profiler.js') }}</script>
|
||||
<!-- /ANBU - LARAVEL PROFILER -->
|
||||
<!-- /ANBU - LARAVEL PROFILER -->
|
||||
|
||||
Reference in New Issue
Block a user