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
e2dd201e
Commit
e2dd201e
authored
Jan 22, 2014
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixes #13 (partially) Use relative time ranges whenever possible when querying graphite
parent
f0c8b70f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
3 deletions
+19
-3
src/app/panels/graphite/module.js
+1
-1
src/app/services/graphite/graphiteSrv.js
+18
-2
No files found.
src/app/panels/graphite/module.js
View file @
e2dd201e
...
@@ -320,7 +320,7 @@ function (angular, app, $, _, kbn, moment, timeSeries) {
...
@@ -320,7 +320,7 @@ function (angular, app, $, _, kbn, moment, timeSeries) {
$scope
.
updateTimeRange
();
$scope
.
updateTimeRange
();
var
graphiteQuery
=
{
var
graphiteQuery
=
{
range
:
$scope
.
range
,
range
:
filterSrv
.
timeRange
(
false
)
,
targets
:
$scope
.
panel
.
targets
,
targets
:
$scope
.
panel
.
targets
,
maxDataPoints
:
$scope
.
panel
.
span
*
50
maxDataPoints
:
$scope
.
panel
.
span
*
50
};
};
...
...
src/app/services/graphite/graphiteSrv.js
View file @
e2dd201e
...
@@ -14,8 +14,8 @@ function (angular, _, $, config) {
...
@@ -14,8 +14,8 @@ function (angular, _, $, config) {
this
.
query
=
function
(
options
)
{
this
.
query
=
function
(
options
)
{
try
{
try
{
var
graphOptions
=
{
var
graphOptions
=
{
from
:
$
.
plot
.
formatDate
(
options
.
range
.
from
,
'%H%:%M_%Y%m%d'
),
from
:
this
.
translateTime
(
options
.
range
.
from
),
until
:
$
.
plot
.
formatDate
(
options
.
range
.
to
,
'%H%:%M_%Y%m%d'
),
until
:
this
.
translateTime
(
options
.
range
.
to
),
targets
:
options
.
targets
,
targets
:
options
.
targets
,
maxDataPoints
:
options
.
maxDataPoints
maxDataPoints
:
options
.
maxDataPoints
};
};
...
@@ -34,6 +34,22 @@ function (angular, _, $, config) {
...
@@ -34,6 +34,22 @@ function (angular, _, $, config) {
}
}
};
};
this
.
translateTime
=
function
(
date
)
{
if
(
_
.
isDate
(
date
))
{
return
$
.
plot
.
formatDate
(
date
,
'%H%:%M_%Y%m%d'
);
}
if
(
date
===
'now'
)
{
return
'now'
;
}
date
=
date
.
substring
(
3
);
date
=
date
.
replace
(
'm'
,
'min'
);
date
=
date
.
replace
(
'M'
,
'mon'
);
return
date
;
};
this
.
match
=
function
(
targets
,
graphiteTargetStr
)
{
this
.
match
=
function
(
targets
,
graphiteTargetStr
)
{
var
found
=
targets
[
0
];
var
found
=
targets
[
0
];
...
...
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