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
289a33bf
Commit
289a33bf
authored
Sep 03, 2019
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated is time series test
parent
7cec3834
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
9 deletions
+12
-9
public/app/features/explore/utils/ResultProcessor.ts
+12
-9
No files found.
public/app/features/explore/utils/ResultProcessor.ts
View file @
289a33bf
...
@@ -18,7 +18,7 @@ export class ResultProcessor {
...
@@ -18,7 +18,7 @@ export class ResultProcessor {
return
[];
return
[];
}
}
const
onlyTimeSeries
=
this
.
dataFrames
.
filter
(
series
=>
series
.
fields
.
length
===
2
);
const
onlyTimeSeries
=
this
.
dataFrames
.
filter
(
isTimeSeries
);
return
getGraphSeriesModel
(
return
getGraphSeriesModel
(
onlyTimeSeries
,
onlyTimeSeries
,
...
@@ -36,14 +36,7 @@ export class ResultProcessor {
...
@@ -36,14 +36,7 @@ export class ResultProcessor {
// For now ignore time series
// For now ignore time series
// We can change this later, just need to figure out how to
// We can change this later, just need to figure out how to
// Ignore time series only for prometheus
// Ignore time series only for prometheus
const
onlyTables
=
this
.
dataFrames
.
filter
(
frame
=>
{
const
onlyTables
=
this
.
dataFrames
.
filter
(
frame
=>
!
isTimeSeries
(
frame
));
if
(
frame
.
fields
.
length
===
2
)
{
if
(
frame
.
fields
[
1
].
type
===
FieldType
.
time
)
{
return
false
;
}
}
return
true
;
});
const
tables
=
onlyTables
.
map
(
frame
=>
{
const
tables
=
onlyTables
.
map
(
frame
=>
{
const
{
fields
}
=
frame
;
const
{
fields
}
=
frame
;
...
@@ -113,3 +106,13 @@ export class ResultProcessor {
...
@@ -113,3 +106,13 @@ export class ResultProcessor {
return
{
...
sortedNewResults
,
rows
,
series
};
return
{
...
sortedNewResults
,
rows
,
series
};
}
}
}
}
export
function
isTimeSeries
(
frame
:
DataFrame
):
boolean
{
if
(
frame
.
fields
.
length
===
2
)
{
if
(
frame
.
fields
[
1
].
type
===
FieldType
.
time
)
{
return
true
;
}
}
return
false
;
}
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