Commit 47425145 by Mark

method renamed, more php-docs added

parent 717d2641
...@@ -21,7 +21,9 @@ use yii\debug\models\search\Db; ...@@ -21,7 +21,9 @@ use yii\debug\models\search\Db;
class DbPanel extends Panel class DbPanel extends Panel
{ {
/** /**
* @var integer total queries critical count * @var integer the threshold for determining whether the request has involved
* critical number of DB queries. If the number of queries exceeds this number,
* the execution is considered taking critical number of DB queries.
*/ */
public $criticalQueryThreshold; public $criticalQueryThreshold;
/** /**
...@@ -158,7 +160,7 @@ class DbPanel extends Panel ...@@ -158,7 +160,7 @@ class DbPanel extends Panel
* @param integer $count queries count * @param integer $count queries count
* @return boolean * @return boolean
*/ */
public function isQueriesCountCritical($count) public function isQueryCountCritical($count)
{ {
return (($this->criticalQueryThreshold !== null) && ($count > $this->criticalQueryThreshold)); return (($this->criticalQueryThreshold !== null) && ($count > $this->criticalQueryThreshold));
} }
......
...@@ -34,7 +34,7 @@ echo GridView::widget([ ...@@ -34,7 +34,7 @@ echo GridView::widget([
'rowOptions' => function ($model, $key, $index, $grid) use ($searchModel) { 'rowOptions' => function ($model, $key, $index, $grid) use ($searchModel) {
$dbPanel = $this->context->module->panels['db']; $dbPanel = $this->context->module->panels['db'];
if ($searchModel->isCodeCritical($model['statusCode']) || $dbPanel->isQueriesCountCritical($model['sqlCount'])) { if ($searchModel->isCodeCritical($model['statusCode']) || $dbPanel->isQueryCountCritical($model['sqlCount'])) {
return ['class'=>'danger']; return ['class'=>'danger'];
} else { } else {
return []; return [];
...@@ -64,7 +64,7 @@ echo GridView::widget([ ...@@ -64,7 +64,7 @@ echo GridView::widget([
'value' => function ($data) { 'value' => function ($data) {
$dbPanel = $this->context->module->panels['db']; $dbPanel = $this->context->module->panels['db'];
if ($dbPanel->isQueriesCountCritical($data['sqlCount'])) { if ($dbPanel->isQueryCountCritical($data['sqlCount'])) {
$content = Html::tag('b', $data['sqlCount']) . ' ' . Html::tag('span','',['class' => 'glyphicon glyphicon-exclamation-sign']); $content = Html::tag('b', $data['sqlCount']) . ' ' . Html::tag('span','',['class' => 'glyphicon glyphicon-exclamation-sign']);
return Html::a($content, $dbPanel->getUrl(), [ return Html::a($content, $dbPanel->getUrl(), [
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment