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
b8029dcd
Unverified
Commit
b8029dcd
authored
Nov 12, 2019
by
Kyle Brandt
Committed by
GitHub
Nov 12, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
transform_plugin: pass encoded dataframes through (#20333)
parent
6959cf77
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
9 deletions
+12
-9
pkg/plugins/transform_plugin.go
+12
-9
No files found.
pkg/plugins/transform_plugin.go
View file @
b8029dcd
...
...
@@ -239,18 +239,23 @@ func (s *grafanaAPI) QueryDatasource(ctx context.Context, req *pluginv2.QueryDat
if
err
!=
nil
{
return
nil
,
err
}
// Convert tsdb results (map) to plugin-model/datasource (slice) results
// Only error and Series responses mapped.
results
:=
make
([]
*
pluginv2
.
DatasourceQueryResult
,
len
(
tsdbRes
.
Results
))
resIdx
:=
0
// Convert tsdb results (map) to plugin-model/datasource (slice) results.
// Only error, tsdb.Series, and encoded Dataframes responses are mapped.
results
:=
make
([]
*
pluginv2
.
DatasourceQueryResult
,
0
,
len
(
tsdbRes
.
Results
))
for
refID
,
res
:=
range
tsdbRes
.
Results
{
qr
:=
&
pluginv2
.
DatasourceQueryResult
{
RefId
:
refID
,
}
if
res
.
Error
!=
nil
{
qr
.
Error
=
res
.
ErrorString
results
[
resIdx
]
=
qr
resIdx
++
results
=
append
(
results
,
qr
)
continue
}
if
res
.
Dataframes
!=
nil
{
qr
.
Dataframes
=
append
(
qr
.
Dataframes
,
res
.
Dataframes
...
)
results
=
append
(
results
,
qr
)
continue
}
...
...
@@ -266,9 +271,7 @@ func (s *grafanaAPI) QueryDatasource(ctx context.Context, req *pluginv2.QueryDat
}
}
qr
.
Dataframes
=
encodedFrames
results
[
resIdx
]
=
qr
resIdx
++
results
=
append
(
results
,
qr
)
}
return
&
pluginv2
.
QueryDatasourceResponse
{
Results
:
results
},
nil
}
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