You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

66 lines
2.0KB

  1. <?php
  2. /* @var $panel yii\debug\panels\ProfilingPanel */
  3. /* @var $searchModel yii\debug\models\search\Profile */
  4. /* @var $dataProvider yii\data\ArrayDataProvider */
  5. /* @var $time integer */
  6. /* @var $memory integer */
  7. use yii\grid\GridView;
  8. use yii\helpers\Html;
  9. ?>
  10. <h1>Performance Profiling</h1>
  11. <p>
  12. Total processing time: <b><?= $time ?></b>; Peak memory: <b><?= $memory ?></b>.
  13. <?= Html::a('Show Profiling Timeline', ['/' . $panel->module->id . '/default/view',
  14. 'panel' => 'timeline',
  15. 'tag' => $panel->tag,
  16. ]) ?>
  17. </p>
  18. <?php
  19. echo GridView::widget([
  20. 'dataProvider' => $dataProvider,
  21. 'id' => 'profile-panel-detailed-grid',
  22. 'options' => ['class' => 'detail-grid-view table-responsive'],
  23. 'filterModel' => $searchModel,
  24. 'filterUrl' => $panel->getUrl(),
  25. 'columns' => [
  26. [
  27. 'attribute' => 'seq',
  28. 'label' => 'Time',
  29. 'value' => function ($data) {
  30. $timeInSeconds = $data['timestamp'] / 1000;
  31. $millisecondsDiff = (int) (($timeInSeconds - (int) $timeInSeconds) * 1000);
  32. return date('H:i:s.', $timeInSeconds) . sprintf('%03d', $millisecondsDiff);
  33. },
  34. 'headerOptions' => [
  35. 'class' => 'sort-numerical'
  36. ]
  37. ],
  38. [
  39. 'attribute' => 'duration',
  40. 'value' => function ($data) {
  41. return sprintf('%.1f ms', $data['duration']);
  42. },
  43. 'options' => [
  44. 'width' => '10%',
  45. ],
  46. 'headerOptions' => [
  47. 'class' => 'sort-numerical'
  48. ]
  49. ],
  50. 'category',
  51. [
  52. 'attribute' => 'info',
  53. 'value' => function ($data) {
  54. return str_repeat('<span class="indent">→</span>', $data['level']) . Html::encode($data['info']);
  55. },
  56. 'format' => 'html',
  57. 'options' => [
  58. 'width' => '60%',
  59. ],
  60. ],
  61. ],
  62. ]);