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
407f1ad4
Commit
407f1ad4
authored
Aug 28, 2017
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
https://github.com/pdoan017/grafana
parents
62f57709
3eea5d23
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
2 deletions
+6
-2
pkg/tsdb/mysql/mysql.go
+6
-2
No files found.
pkg/tsdb/mysql/mysql.go
View file @
407f1ad4
package
mysql
import
(
"container/list"
"context"
"database/sql"
"fmt"
...
...
@@ -245,6 +246,7 @@ func (e MysqlExecutor) getTypedRowData(types []*sql.ColumnType, rows *core.Rows)
func
(
e
MysqlExecutor
)
TransformToTimeSeries
(
query
*
tsdb
.
Query
,
rows
*
core
.
Rows
,
result
*
tsdb
.
QueryResult
)
error
{
pointsBySeries
:=
make
(
map
[
string
]
*
tsdb
.
TimeSeries
)
seriesByQueryOrder
:=
list
.
New
()
columnNames
,
err
:=
rows
.
Columns
()
if
err
!=
nil
{
...
...
@@ -282,11 +284,13 @@ func (e MysqlExecutor) TransformToTimeSeries(query *tsdb.Query, rows *core.Rows,
series
:=
&
tsdb
.
TimeSeries
{
Name
:
rowData
.
metric
}
series
.
Points
=
append
(
series
.
Points
,
tsdb
.
TimePoint
{
rowData
.
value
,
rowData
.
time
})
pointsBySeries
[
rowData
.
metric
]
=
series
seriesByQueryOrder
.
PushBack
(
rowData
.
metric
)
}
}
for
_
,
value
:=
range
pointsBySeries
{
result
.
Series
=
append
(
result
.
Series
,
value
)
for
elem
:=
seriesByQueryOrder
.
Front
();
elem
!=
nil
;
elem
=
elem
.
Next
()
{
key
:=
elem
.
Value
.
(
string
)
result
.
Series
=
append
(
result
.
Series
,
pointsBySeries
[
key
])
}
result
.
Meta
.
Set
(
"rowCount"
,
rowCount
)
...
...
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