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
69b87fdb
Commit
69b87fdb
authored
Feb 22, 2016
by
benrubson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
make auto interval calculation more accurate
parent
8f9c3c83
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
42 additions
and
15 deletions
+42
-15
public/app/core/utils/kbn.js
+42
-15
No files found.
public/app/core/utils/kbn.js
View file @
69b87fdb
...
@@ -12,39 +12,66 @@ function($, _) {
...
@@ -12,39 +12,66 @@ function($, _) {
kbn
.
round_interval
=
function
(
interval
)
{
kbn
.
round_interval
=
function
(
interval
)
{
switch
(
true
)
{
switch
(
true
)
{
// 0.
5
s
// 0.
3
s
case
(
interval
<=
5
00
):
case
(
interval
<=
3
00
):
return
100
;
// 0.1s
return
100
;
// 0.1s
// 5s
// 0.75s
case
(
interval
<=
5000
):
case
(
interval
<=
750
):
return
500
;
// 0.5s
// 1.5s
case
(
interval
<=
1500
):
return
1000
;
// 1s
return
1000
;
// 1s
// 3.5s
case
(
interval
<=
3500
):
return
2000
;
// 2s
// 7.5s
// 7.5s
case
(
interval
<=
7500
):
case
(
interval
<=
7500
):
return
5000
;
// 5s
return
5000
;
// 5s
// 15s
// 1
2.
5s
case
(
interval
<=
1
50
00
):
case
(
interval
<=
1
25
00
):
return
10000
;
// 10s
return
10000
;
// 10s
// 17.5s
case
(
interval
<=
17500
):
return
15000
;
// 15s
// 25s
case
(
interval
<=
25000
):
return
20000
;
// 20s
// 45s
// 45s
case
(
interval
<=
45000
):
case
(
interval
<=
45000
):
return
30000
;
// 30s
return
30000
;
// 30s
//
3
m
//
1.5
m
case
(
interval
<=
18
0000
):
case
(
interval
<=
9
0000
):
return
60000
;
// 1m
return
60000
;
// 1m
// 9m
// 3.5m
case
(
interval
<=
210000
):
return
120000
;
// 2m
// 7.5m
case
(
interval
<=
450000
):
case
(
interval
<=
450000
):
return
300000
;
// 5m
return
300000
;
// 5m
//
20
m
//
12.5
m
case
(
interval
<=
120
0000
):
case
(
interval
<=
75
0000
):
return
600000
;
// 10m
return
600000
;
// 10m
// 12.5m
case
(
interval
<=
1050000
):
return
900000
;
// 15m
// 25m
case
(
interval
<=
1500000
):
return
1200000
;
// 20m
// 45m
// 45m
case
(
interval
<=
2700000
):
case
(
interval
<=
2700000
):
return
1800000
;
// 30m
return
1800000
;
// 30m
//
2
h
//
1.5
h
case
(
interval
<=
72
00000
):
case
(
interval
<=
54
00000
):
return
3600000
;
// 1h
return
3600000
;
// 1h
// 6h
// 2.5h
case
(
interval
<=
21600000
):
case
(
interval
<=
9000000
):
return
7200000
;
// 2h
// 4.5h
case
(
interval
<=
16200000
):
return
10800000
;
// 3h
return
10800000
;
// 3h
// 9h
case
(
interval
<=
32400000
):
return
21600000
;
// 6h
// 24h
// 24h
case
(
interval
<=
86400000
):
case
(
interval
<=
86400000
):
return
43200000
;
// 12h
return
43200000
;
// 12h
...
...
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