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
62269bb8
Commit
62269bb8
authored
Dec 06, 2016
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
change(influxdb): always specify absolute time range in milliseconds, refactoring #6571
parent
c6bb86d8
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
9 deletions
+4
-9
public/app/plugins/datasource/influxdb/datasource.ts
+4
-9
No files found.
public/app/plugins/datasource/influxdb/datasource.ts
View file @
62269bb8
...
...
@@ -250,11 +250,9 @@ export default class InfluxDatasource {
};
getTimeFilter
(
options
)
{
var
inMS
=
elapsed
<
(
5
*
60000
);
var
from
=
this
.
getInfluxTime
(
options
.
rangeRaw
.
from
,
false
,
inMS
);
var
until
=
this
.
getInfluxTime
(
options
.
rangeRaw
.
to
,
true
,
inMS
);
var
fromIsAbsolute
=
from
[
from
.
length
-
1
]
===
's'
;
var
from
=
this
.
getInfluxTime
(
options
.
rangeRaw
.
from
,
false
);
var
until
=
this
.
getInfluxTime
(
options
.
rangeRaw
.
to
,
true
);
var
fromIsAbsolute
=
from
[
from
.
length
-
1
]
===
'ms'
;
if
(
until
===
'now()'
&&
!
fromIsAbsolute
)
{
return
'time > '
+
from
;
...
...
@@ -263,7 +261,7 @@ export default class InfluxDatasource {
return
'time > '
+
from
+
' and time < '
+
until
;
}
getInfluxTime
(
date
,
roundUp
,
inMS
)
{
getInfluxTime
(
date
,
roundUp
)
{
if
(
_
.
isString
(
date
))
{
if
(
date
===
'now'
)
{
return
'now()'
;
...
...
@@ -278,10 +276,7 @@ export default class InfluxDatasource {
date
=
dateMath
.
parse
(
date
,
roundUp
);
}
if
(
inMS
)
{
return
date
.
valueOf
()
+
'ms'
;
}
return
(
date
.
valueOf
()
/
1000
).
toFixed
(
0
)
+
's'
;
}
}
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