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 {
DataFrame
,
FieldType
,
TimeZone
,
toDataFrame
,
getDisplayProcessor
,
ExploreMode
,
PreferredVisualisationType
,
standardTransformers
,
}
from
'@grafana/data'
;
import
{
ExploreItemState
}
from
'app/types/explore'
;
import
TableModel
,
{
mergeTablesIntoModel
,
MutableColumn
}
from
'app/core/table_model'
;
import
{
sortLogsResult
,
refreshIntervalToSortOrder
}
from
'app/core/utils/explore'
;
import
{
dataFrameToLogsModel
}
from
'app/core/logs_model'
;
import
{
getGraphSeriesModel
}
from
'app/plugins/panel/graph2/getGraphSeriesModel'
;
...
...
@@ -69,36 +68,8 @@ export class ResultProcessor {
return
null
;
}
const
tables
=
onlyTables
.
map
(
frame
=>
{
const
{
fields
}
=
frame
;
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
);
const
mergeTransformer
=
standardTransformers
.
mergeTransformer
.
transformer
({});
const
data
=
mergeTransformer
(
onlyTables
)[
0
];
// set display processor
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