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
e5e9d3c2
Commit
e5e9d3c2
authored
Mar 20, 2018
by
Daniel Lee
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mssql: adds test for time should be ms in table mode
parent
d34cd873
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
0 deletions
+27
-0
pkg/tsdb/mssql/mssql_test.go
+27
-0
No files found.
pkg/tsdb/mssql/mssql_test.go
View file @
e5e9d3c2
...
...
@@ -654,6 +654,33 @@ func TestMSSQL(t *testing.T) {
So
(
err
,
ShouldBeNil
)
So
(
len
(
queryResult
.
Tables
[
0
]
.
Rows
),
ShouldEqual
,
3
)
})
Convey
(
"When doing an annotation query with a time column in datetime format"
,
func
()
{
query
:=
&
tsdb
.
TsdbQuery
{
Queries
:
[]
*
tsdb
.
Query
{
{
Model
:
simplejson
.
NewFromAny
(
map
[
string
]
interface
{}{
"rawSql"
:
"SELECT DATEADD(s, time_sec, {d '1970-01-01'}) AS time, description as [text], tags FROM [event] WHERE $__unixEpochFilter(time_sec) AND tags='ticket' ORDER BY 1 ASC"
,
"format"
:
"table"
,
}),
RefId
:
"Tickets"
,
},
},
TimeRange
:
&
tsdb
.
TimeRange
{
From
:
fmt
.
Sprintf
(
"%v"
,
fromStart
.
Add
(
-
20
*
time
.
Minute
)
.
Unix
()
*
1000
),
To
:
fmt
.
Sprintf
(
"%v"
,
fromStart
.
Add
(
40
*
time
.
Minute
)
.
Unix
()
*
1000
),
},
}
resp
,
err
:=
endpoint
.
Query
(
nil
,
nil
,
query
)
queryResult
:=
resp
.
Results
[
"Tickets"
]
So
(
err
,
ShouldBeNil
)
So
(
len
(
queryResult
.
Tables
[
0
]
.
Rows
),
ShouldEqual
,
3
)
columns
:=
queryResult
.
Tables
[
0
]
.
Rows
[
0
]
//Should be in milliseconds
So
(
columns
[
0
]
.
(
float64
),
ShouldBeGreaterThan
,
1000000000000
)
})
})
})
}
...
...
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