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
920a0c4f
Commit
920a0c4f
authored
Apr 09, 2018
by
ryan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
skip mssql fix
parent
7d6c8aa6
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
pkg/tsdb/mssql/macros.go
+6
-6
No files found.
pkg/tsdb/mssql/macros.go
View file @
920a0c4f
...
...
@@ -82,11 +82,11 @@ func (m *MsSqlMacroEngine) evaluateMacro(name string, args []string) (string, er
if
len
(
args
)
==
0
{
return
""
,
fmt
.
Errorf
(
"missing time column argument for macro %v"
,
name
)
}
return
fmt
.
Sprintf
(
"%s >= DATEADD(s, %d, '1970-01-01') AND %s <= DATEADD(s, %d, '1970-01-01')"
,
args
[
0
],
int64
(
m
.
TimeRange
.
GetFromAsMsEpoch
()
/
1000
),
args
[
0
],
int64
(
m
.
TimeRange
.
GetToAsMsEpoch
()
/
1000
)),
nil
return
fmt
.
Sprintf
(
"%s >= DATEADD(s, %d, '1970-01-01') AND %s <= DATEADD(s, %d, '1970-01-01')"
,
args
[
0
],
uint64
(
m
.
TimeRange
.
GetFromAsMsEpoch
()
/
1000
),
args
[
0
],
u
int64
(
m
.
TimeRange
.
GetToAsMsEpoch
()
/
1000
)),
nil
case
"__timeFrom"
:
return
fmt
.
Sprintf
(
"DATEADD(second, %d, '1970-01-01')"
,
int64
(
m
.
TimeRange
.
GetFromAsMsEpoch
()
/
1000
)),
nil
return
fmt
.
Sprintf
(
"DATEADD(second, %d, '1970-01-01')"
,
u
int64
(
m
.
TimeRange
.
GetFromAsMsEpoch
()
/
1000
)),
nil
case
"__timeTo"
:
return
fmt
.
Sprintf
(
"DATEADD(second, %d, '1970-01-01')"
,
int64
(
m
.
TimeRange
.
GetToAsMsEpoch
()
/
1000
)),
nil
return
fmt
.
Sprintf
(
"DATEADD(second, %d, '1970-01-01')"
,
u
int64
(
m
.
TimeRange
.
GetToAsMsEpoch
()
/
1000
)),
nil
case
"__timeGroup"
:
if
len
(
args
)
<
2
{
return
""
,
fmt
.
Errorf
(
"macro %v needs time column and interval"
,
name
)
...
...
@@ -113,11 +113,11 @@ func (m *MsSqlMacroEngine) evaluateMacro(name string, args []string) (string, er
if
len
(
args
)
==
0
{
return
""
,
fmt
.
Errorf
(
"missing time column argument for macro %v"
,
name
)
}
return
fmt
.
Sprintf
(
"%s >= %d AND %s <= %d"
,
args
[
0
],
int64
(
m
.
TimeRange
.
GetFromAsMsEpoch
()
/
1000
),
args
[
0
],
int64
(
m
.
TimeRange
.
GetToAsMsEpoch
()
/
1000
)),
nil
return
fmt
.
Sprintf
(
"%s >= %d AND %s <= %d"
,
args
[
0
],
uint64
(
m
.
TimeRange
.
GetFromAsMsEpoch
()
/
1000
),
args
[
0
],
u
int64
(
m
.
TimeRange
.
GetToAsMsEpoch
()
/
1000
)),
nil
case
"__unixEpochFrom"
:
return
fmt
.
Sprintf
(
"%d"
,
int64
(
m
.
TimeRange
.
GetFromAsMsEpoch
()
/
1000
)),
nil
return
fmt
.
Sprintf
(
"%d"
,
u
int64
(
m
.
TimeRange
.
GetFromAsMsEpoch
()
/
1000
)),
nil
case
"__unixEpochTo"
:
return
fmt
.
Sprintf
(
"%d"
,
int64
(
m
.
TimeRange
.
GetToAsMsEpoch
()
/
1000
)),
nil
return
fmt
.
Sprintf
(
"%d"
,
u
int64
(
m
.
TimeRange
.
GetToAsMsEpoch
()
/
1000
)),
nil
default
:
return
""
,
fmt
.
Errorf
(
"Unknown macro %v"
,
name
)
}
...
...
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