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
0534d43a
Commit
0534d43a
authored
Nov 28, 2016
by
Ryan McKinley
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use ms when query less then 5 mins
parent
1ce0d817
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
4 deletions
+10
-4
public/app/plugins/datasource/influxdb/datasource.ts
+10
-4
No files found.
public/app/plugins/datasource/influxdb/datasource.ts
View file @
0534d43a
...
@@ -250,8 +250,10 @@ export default class InfluxDatasource {
...
@@ -250,8 +250,10 @@ export default class InfluxDatasource {
};
};
getTimeFilter
(
options
)
{
getTimeFilter
(
options
)
{
var
from
=
this
.
getInfluxTime
(
options
.
rangeRaw
.
from
,
false
);
var
inMS
=
elapsed
<
(
5
*
60000
);
var
until
=
this
.
getInfluxTime
(
options
.
rangeRaw
.
to
,
true
);
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
fromIsAbsolute
=
from
[
from
.
length
-
1
]
===
's'
;
if
(
until
===
'now()'
&&
!
fromIsAbsolute
)
{
if
(
until
===
'now()'
&&
!
fromIsAbsolute
)
{
...
@@ -261,7 +263,7 @@ export default class InfluxDatasource {
...
@@ -261,7 +263,7 @@ export default class InfluxDatasource {
return
'time > '
+
from
+
' and time < '
+
until
;
return
'time > '
+
from
+
' and time < '
+
until
;
}
}
getInfluxTime
(
date
,
roundUp
)
{
getInfluxTime
(
date
,
roundUp
,
inMS
)
{
if
(
_
.
isString
(
date
))
{
if
(
_
.
isString
(
date
))
{
if
(
date
===
'now'
)
{
if
(
date
===
'now'
)
{
return
'now()'
;
return
'now()'
;
...
@@ -275,7 +277,11 @@ export default class InfluxDatasource {
...
@@ -275,7 +277,11 @@ export default class InfluxDatasource {
}
}
date
=
dateMath
.
parse
(
date
,
roundUp
);
date
=
dateMath
.
parse
(
date
,
roundUp
);
}
}
return
date
.
valueOf
()
+
'ms'
;
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