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
e487fabc
Commit
e487fabc
authored
Jul 27, 2018
by
Sven Klemm
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add metric column prefix test for mysql
parent
036647ae
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
0 deletions
+25
-0
pkg/tsdb/mysql/mysql_test.go
+25
-0
No files found.
pkg/tsdb/mysql/mysql_test.go
View file @
e487fabc
...
...
@@ -634,6 +634,31 @@ func TestMySQL(t *testing.T) {
So
(
queryResult
.
Series
[
1
]
.
Name
,
ShouldEqual
,
"Metric B - value one"
)
})
Convey
(
"When doing a metric query with metric column and multiple value columns"
,
func
()
{
query
:=
&
tsdb
.
TsdbQuery
{
Queries
:
[]
*
tsdb
.
Query
{
{
Model
:
simplejson
.
NewFromAny
(
map
[
string
]
interface
{}{
"rawSql"
:
`SELECT $__time(time), measurement as metric, valueOne, valueTwo FROM metric_values ORDER BY 1,2`
,
"format"
:
"time_series"
,
}),
RefId
:
"A"
,
},
},
}
resp
,
err
:=
endpoint
.
Query
(
nil
,
nil
,
query
)
So
(
err
,
ShouldBeNil
)
queryResult
:=
resp
.
Results
[
"A"
]
So
(
queryResult
.
Error
,
ShouldBeNil
)
So
(
len
(
queryResult
.
Series
),
ShouldEqual
,
4
)
So
(
queryResult
.
Series
[
0
]
.
Name
,
ShouldEqual
,
"Metric A valueOne"
)
So
(
queryResult
.
Series
[
1
]
.
Name
,
ShouldEqual
,
"Metric A valueTwo"
)
So
(
queryResult
.
Series
[
2
]
.
Name
,
ShouldEqual
,
"Metric B valueOne"
)
So
(
queryResult
.
Series
[
3
]
.
Name
,
ShouldEqual
,
"Metric B valueTwo"
)
})
Convey
(
"When doing a metric query grouping by time should return correct series"
,
func
()
{
query
:=
&
tsdb
.
TsdbQuery
{
Queries
:
[]
*
tsdb
.
Query
{
...
...
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