Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nexpie-grafana-theme
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kornkitt Poolsup
nexpie-grafana-theme
Commits
513c79d3
Commit
513c79d3
authored
May 06, 2019
by
Ryan McKinley
Committed by
Torkel Ödegaard
May 06, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
PanelQueryState: check for existing running query (#16894)
Fixes #16880
parent
ec500ed4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
4 deletions
+13
-4
public/app/features/dashboard/state/PanelQueryState.test.ts
+12
-4
public/app/features/dashboard/state/PanelQueryState.ts
+1
-0
No files found.
public/app/features/dashboard/state/PanelQueryState.test.ts
View file @
513c79d3
...
...
@@ -34,14 +34,22 @@ describe('PanelQueryState', () => {
expect
(
empty
.
series
.
length
).
toBe
(
0
);
expect
(
hasRun
).
toBeFalsy
();
empty
=
await
state
.
execute
(
ds
,
getQueryOptions
({
targets
:
[{
hide
:
true
,
refId
:
'X'
},
{
hide
:
true
,
refId
:
'Y'
},
{
hide
:
true
,
refId
:
'Z'
}]
})
);
const
query
=
getQueryOptions
({
targets
:
[{
hide
:
true
,
refId
:
'X'
},
{
hide
:
true
,
refId
:
'Y'
},
{
hide
:
true
,
refId
:
'Z'
}],
});
empty
=
await
state
.
execute
(
ds
,
query
);
// should not run any hidden queries'
expect
(
state
.
getActiveRunner
()).
toBeFalsy
();
expect
(
empty
.
series
.
length
).
toBe
(
0
);
expect
(
hasRun
).
toBeFalsy
();
// Check for the same query
expect
(
state
.
isSameQuery
(
ds
,
query
)).
toBeTruthy
();
// Check for differnet queries
expect
(
state
.
isSameQuery
(
new
MockDataSourceApi
(
'test'
),
query
)).
toBeFalsy
();
expect
(
state
.
isSameQuery
(
ds
,
getQueryOptions
({
targets
:
[{
refId
:
'differnet'
}]
}))).
toBeFalsy
();
});
});
...
...
public/app/features/dashboard/state/PanelQueryState.ts
View file @
513c79d3
...
...
@@ -95,6 +95,7 @@ export class PanelQueryState {
execute
(
ds
:
DataSourceApi
,
req
:
DataQueryRequest
):
Promise
<
PanelData
>
{
this
.
request
=
req
;
this
.
datasource
=
ds
;
// Return early if there are no queries to run
if
(
!
req
.
targets
.
length
)
{
...
...
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