profile-callstack.php 834 B

12345678910111213141516171819202122232425262728
  1. <!-- start profiling callstack -->
  2. <table class="yiiLog" width="100%" cellpadding="2"
  3. style="border-spacing: 1px; font: 11px Verdana, Arial, Helvetica, sans-serif; background: #EEEEEE; color: #666666;">
  4. <tr>
  5. <th style="background: black; color: white;" colspan="2">程序概要分析 - 堆栈调用报告</th>
  6. </tr>
  7. <tr style="background-color: #ccc;">
  8. <th>步骤</th>
  9. <th>时间 (秒)</th>
  10. </tr>
  11. <?php
  12. foreach ( $data as $index => $entry ) {
  13. $color = ($index % 2) ? '#F5F5F5' : '#FFFFFF';
  14. list ( $proc, $time, $level ) = $entry;
  15. $proc = CHtml::encode ( $proc );
  16. $time = sprintf ( '%0.5f', $time );
  17. $spaces = str_repeat ( '&nbsp;', $level * 8 );
  18. echo <<<EOD
  19. <tr style="background:{$color}">
  20. <td>{$spaces}{$proc}</td>
  21. <td align="center">{$time}</td>
  22. </tr>
  23. EOD;
  24. }
  25. ?>
  26. </table>
  27. <!-- end of profiling callstack -->