Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yii2
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PSDI Army
yii2
Commits
47425145
Commit
47425145
authored
Feb 03, 2014
by
Mark
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
method renamed, more php-docs added
parent
717d2641
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
4 deletions
+6
-4
DbPanel.php
extensions/debug/panels/DbPanel.php
+4
-2
index.php
extensions/debug/views/default/index.php
+2
-2
No files found.
extensions/debug/panels/DbPanel.php
View file @
47425145
...
...
@@ -21,7 +21,9 @@ use yii\debug\models\search\Db;
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
;
/**
...
...
@@ -158,7 +160,7 @@ class DbPanel extends Panel
* @param integer $count queries count
* @return boolean
*/
public
function
isQuer
ies
CountCritical
(
$count
)
public
function
isQuer
y
CountCritical
(
$count
)
{
return
((
$this
->
criticalQueryThreshold
!==
null
)
&&
(
$count
>
$this
->
criticalQueryThreshold
));
}
...
...
extensions/debug/views/default/index.php
View file @
47425145
...
...
@@ -34,7 +34,7 @@ echo GridView::widget([
'rowOptions'
=>
function
(
$model
,
$key
,
$index
,
$grid
)
use
(
$searchModel
)
{
$dbPanel
=
$this
->
context
->
module
->
panels
[
'db'
];
if
(
$searchModel
->
isCodeCritical
(
$model
[
'statusCode'
])
||
$dbPanel
->
isQuer
ies
CountCritical
(
$model
[
'sqlCount'
]))
{
if
(
$searchModel
->
isCodeCritical
(
$model
[
'statusCode'
])
||
$dbPanel
->
isQuer
y
CountCritical
(
$model
[
'sqlCount'
]))
{
return
[
'class'
=>
'danger'
];
}
else
{
return
[];
...
...
@@ -64,7 +64,7 @@ echo GridView::widget([
'value'
=>
function
(
$data
)
{
$dbPanel
=
$this
->
context
->
module
->
panels
[
'db'
];
if
(
$dbPanel
->
isQuer
ies
CountCritical
(
$data
[
'sqlCount'
]))
{
if
(
$dbPanel
->
isQuer
y
CountCritical
(
$data
[
'sqlCount'
]))
{
$content
=
Html
::
tag
(
'b'
,
$data
[
'sqlCount'
])
.
' '
.
Html
::
tag
(
'span'
,
''
,[
'class'
=>
'glyphicon glyphicon-exclamation-sign'
]);
return
Html
::
a
(
$content
,
$dbPanel
->
getUrl
(),
[
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment