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.
54 lines
1.3 KiB
54 lines
1.3 KiB
11 years ago
|
<?php
|
||
11 years ago
|
use yii\grid\GridView;
|
||
11 years ago
|
use yii\helpers\Html;
|
||
11 years ago
|
?>
|
||
|
<h1>Performance Profiling</h1>
|
||
11 years ago
|
<p>Total processing time: <b><?= $time ?></b>; Peak memory: <b><?= $memory ?></b>.</p>
|
||
11 years ago
|
<?php
|
||
|
echo GridView::widget([
|
||
|
'dataProvider' => $dataProvider,
|
||
|
'id' => 'profile-panel-detailed-grid',
|
||
11 years ago
|
'options' => ['class' => 'detail-grid-view'],
|
||
11 years ago
|
'filterModel' => $searchModel,
|
||
|
'filterUrl' => $panel->getUrl(),
|
||
|
'columns' => [
|
||
|
['class' => 'yii\grid\SerialColumn'],
|
||
|
[
|
||
11 years ago
|
'attribute' => 'seq',
|
||
|
'label' => 'Time',
|
||
|
'value' => function ($data) {
|
||
|
$timeInSeconds = $data['timestamp'] / 1000;
|
||
|
$millisecondsDiff = (int)(($timeInSeconds - (int)$timeInSeconds) * 1000);
|
||
11 years ago
|
return date('H:i:s.', $timeInSeconds) . sprintf('%03d', $millisecondsDiff);
|
||
11 years ago
|
},
|
||
11 years ago
|
'headerOptions' => [
|
||
|
'class' => 'sort-numerical'
|
||
|
]
|
||
11 years ago
|
],
|
||
|
[
|
||
11 years ago
|
'attribute' => 'duration',
|
||
11 years ago
|
'value' => function ($data) {
|
||
11 years ago
|
return sprintf('%.1f ms',$data['duration']);
|
||
|
},
|
||
11 years ago
|
'options' => [
|
||
|
'width' => '10%',
|
||
|
],
|
||
11 years ago
|
'headerOptions' => [
|
||
|
'class' => 'sort-numerical'
|
||
|
]
|
||
11 years ago
|
],
|
||
|
'category',
|
||
|
[
|
||
|
'attribute' => 'info',
|
||
11 years ago
|
'value' => function ($data) {
|
||
11 years ago
|
return str_repeat('<span class="indent">→</span>', $data['level']) . Html::encode($data['info']);
|
||
11 years ago
|
},
|
||
11 years ago
|
'format' => 'html',
|
||
11 years ago
|
'options' => [
|
||
|
'width' => '60%',
|
||
|
],
|
||
|
],
|
||
|
],
|
||
|
]);
|
||
11 years ago
|
?>
|