profile-summary.php 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <!-- start profiling summary -->
  2. <table class="yiiLog" width="100%" cellpadding="2" style="border-spacing:1px;font:11px Verdana, Arial, Helvetica, sans-serif;background:#EEEEEE;color:#666666;">
  3. <tr>
  4. <th style="background:black;color:white;" colspan="6">
  5. Zhrnutie profilovej zprávy
  6. (Čas: <?php echo sprintf('%0.5f',Yii::getLogger()->getExecutionTime()); ?>s,
  7. Pamäť: <?php echo number_format(Yii::getLogger()->getMemoryUsage()/1024); ?>KB)
  8. </th>
  9. </tr>
  10. <tr style="background-color: #ccc;">
  11. <th>Funkcia</th>
  12. <th>Počet</th>
  13. <th>Celkom (s)</th>
  14. <th>Priemer. (s)</th>
  15. <th>Min. (s)</th>
  16. <th>Max. (s)</th>
  17. </tr>
  18. <?php
  19. foreach($data as $index=>$entry)
  20. {
  21. $color=($index%2)?'#F5F5F5':'#FFFFFF';
  22. $proc=CHtml::encode($entry[0]);
  23. $min=sprintf('%0.5f',$entry[2]);
  24. $max=sprintf('%0.5f',$entry[3]);
  25. $total=sprintf('%0.5f',$entry[4]);
  26. $average=sprintf('%0.5f',$entry[4]/$entry[1]);
  27. echo <<<EOD
  28. <tr style="background:{$color}">
  29. <td>{$proc}</td>
  30. <td align="center">{$entry[1]}</td>
  31. <td align="center">{$total}</td>
  32. <td align="center">{$average}</td>
  33. <td align="center">{$min}</td>
  34. <td align="center">{$max}</td>
  35. </tr>
  36. EOD;
  37. }
  38. ?>
  39. </table>
  40. <!-- end of profiling summary -->