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
02af2dbe
Commit
02af2dbe
authored
Apr 18, 2014
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added rounding for graphites from and to time range filters
for very short absolute ranges (Fixes #320)
parent
b1bd0456
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
3 deletions
+22
-3
CHANGELOG.md
+4
-0
src/app/services/graphite/graphiteDatasource.js
+18
-3
No files found.
CHANGELOG.md
View file @
02af2dbe
# vNext
-
Added rounding for graphites from and to time range filters
for very short absolute ranges (Issue #320)
# 1.5.3 (2014-04-17)
-
Add support for async scripted dashboards (Issue #274)
-
Text panel now accepts html (for links to other dashboards, etc) (Issue #236)
...
...
src/app/services/graphite/graphiteDatasource.js
View file @
02af2dbe
...
...
@@ -24,8 +24,8 @@ function (angular, _, $, config, kbn, moment) {
GraphiteDatasource
.
prototype
.
query
=
function
(
options
)
{
try
{
var
graphOptions
=
{
from
:
this
.
translateTime
(
options
.
range
.
from
),
until
:
this
.
translateTime
(
options
.
range
.
to
),
from
:
this
.
translateTime
(
options
.
range
.
from
,
'round-down'
),
until
:
this
.
translateTime
(
options
.
range
.
to
,
'round-up'
),
targets
:
options
.
targets
,
format
:
options
.
format
,
maxDataPoints
:
options
.
maxDataPoints
,
...
...
@@ -68,7 +68,7 @@ function (angular, _, $, config, kbn, moment) {
}
};
GraphiteDatasource
.
prototype
.
translateTime
=
function
(
date
)
{
GraphiteDatasource
.
prototype
.
translateTime
=
function
(
date
,
rounding
)
{
if
(
_
.
isString
(
date
))
{
if
(
date
===
'now'
)
{
return
'now'
;
...
...
@@ -85,6 +85,21 @@ function (angular, _, $, config, kbn, moment) {
date
=
moment
.
utc
(
date
);
if
(
rounding
===
'round-up'
)
{
if
(
date
.
get
(
's'
))
{
date
.
add
(
'm'
,
1
);
}
}
else
if
(
rounding
===
'round-down'
)
{
// graphite' s from filter is exclusive
// here we step back one minute in order
// to guarantee that we get all the data that
// exists for the specified range
if
(
date
.
get
(
's'
))
{
date
.
subtract
(
'm'
,
1
);
}
}
if
(
dashboard
.
current
.
timezone
===
'browser'
)
{
date
=
date
.
local
();
}
...
...
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