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
95d53f03
Unverified
Commit
95d53f03
authored
Jun 22, 2020
by
Torkel Ödegaard
Committed by
GitHub
Jun 22, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Explore: Use merge transform instead of DataFrame -> Table -> Merge -> toDataFrame (#25694)
parent
eb734a2f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
32 deletions
+3
-32
public/app/features/explore/utils/ResultProcessor.ts
+3
-32
No files found.
public/app/features/explore/utils/ResultProcessor.ts
View file @
95d53f03
...
@@ -4,13 +4,12 @@ import {
...
@@ -4,13 +4,12 @@ import {
DataFrame
,
DataFrame
,
FieldType
,
FieldType
,
TimeZone
,
TimeZone
,
toDataFrame
,
getDisplayProcessor
,
getDisplayProcessor
,
ExploreMode
,
ExploreMode
,
PreferredVisualisationType
,
PreferredVisualisationType
,
standardTransformers
,
}
from
'@grafana/data'
;
}
from
'@grafana/data'
;
import
{
ExploreItemState
}
from
'app/types/explore'
;
import
{
ExploreItemState
}
from
'app/types/explore'
;
import
TableModel
,
{
mergeTablesIntoModel
,
MutableColumn
}
from
'app/core/table_model'
;
import
{
sortLogsResult
,
refreshIntervalToSortOrder
}
from
'app/core/utils/explore'
;
import
{
sortLogsResult
,
refreshIntervalToSortOrder
}
from
'app/core/utils/explore'
;
import
{
dataFrameToLogsModel
}
from
'app/core/logs_model'
;
import
{
dataFrameToLogsModel
}
from
'app/core/logs_model'
;
import
{
getGraphSeriesModel
}
from
'app/plugins/panel/graph2/getGraphSeriesModel'
;
import
{
getGraphSeriesModel
}
from
'app/plugins/panel/graph2/getGraphSeriesModel'
;
...
@@ -69,36 +68,8 @@ export class ResultProcessor {
...
@@ -69,36 +68,8 @@ export class ResultProcessor {
return
null
;
return
null
;
}
}
const
tables
=
onlyTables
.
map
(
frame
=>
{
const
mergeTransformer
=
standardTransformers
.
mergeTransformer
.
transformer
({});
const
{
fields
}
=
frame
;
const
data
=
mergeTransformer
(
onlyTables
)[
0
];
const
fieldCount
=
fields
.
length
;
const
rowCount
=
frame
.
length
;
const
columns
:
MutableColumn
[]
=
fields
.
map
(
field
=>
({
text
:
field
.
name
,
type
:
field
.
type
,
filterable
:
field
.
config
.
filterable
,
custom
:
field
.
config
.
custom
,
}));
const
rows
:
any
[][]
=
[];
for
(
let
i
=
0
;
i
<
rowCount
;
i
++
)
{
const
row
:
any
[]
=
[];
for
(
let
j
=
0
;
j
<
fieldCount
;
j
++
)
{
row
.
push
(
frame
.
fields
[
j
].
values
.
get
(
i
));
}
rows
.
push
(
row
);
}
return
new
TableModel
({
columns
,
rows
,
meta
:
frame
.
meta
,
});
});
const
mergedTable
=
mergeTablesIntoModel
(
new
TableModel
(),
...
tables
);
const
data
=
toDataFrame
(
mergedTable
);
// set display processor
// set display processor
for
(
const
field
of
data
.
fields
)
{
for
(
const
field
of
data
.
fields
)
{
...
...
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