mirror of
https://github.com/yiisoft/yii2.git
synced 2025-08-26 06:15:19 +08:00
changed setting name, fixed php-docs
This commit is contained in:
@ -21,10 +21,9 @@ use yii\debug\models\search\Db;
|
||||
class DbPanel extends Panel
|
||||
{
|
||||
/**
|
||||
*
|
||||
* @var integer total queries critical count
|
||||
*/
|
||||
public $criticalQueriesCount;
|
||||
public $criticalQueryThreshold;
|
||||
/**
|
||||
* @var array db queries info extracted to array as models, to use with data provider.
|
||||
*/
|
||||
@ -155,12 +154,13 @@ class DbPanel extends Panel
|
||||
|
||||
/**
|
||||
* Check if given queries count is critical according settings.
|
||||
* @param queries count $count
|
||||
*
|
||||
* @param integer $count queries count
|
||||
* @return boolean
|
||||
*/
|
||||
public function isQueriesCountCritical($count)
|
||||
{
|
||||
return (($this->criticalQueriesCount !== null) && ($count > $this->criticalQueriesCount));
|
||||
return (($this->criticalQueryThreshold !== null) && ($count > $this->criticalQueryThreshold));
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -68,7 +68,7 @@ echo GridView::widget([
|
||||
|
||||
$content = Html::tag('b', $data['sqlCount']) . ' ' . Html::tag('span','',['class' => 'glyphicon glyphicon-exclamation-sign']);
|
||||
return Html::a($content, $dbPanel->getUrl(), [
|
||||
'title' => 'Query is slow. Allowed count is ' . $dbPanel->criticalQueriesCount,
|
||||
'title' => 'Too many queries. Allowed count is ' . $dbPanel->criticalQueryThreshold,
|
||||
]);
|
||||
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user