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
8a0d5aa3
Commit
8a0d5aa3
authored
May 23, 2016
by
Utkarsh Bhatnagar
Committed by
Torkel Ödegaard
May 23, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Bug Fix] #5136 (#5142)
parent
bbea698a
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
14 deletions
+14
-14
public/app/core/time_series2.ts
+2
-2
public/app/plugins/panel/graph/specs/graph_ctrl_specs.ts
+9
-9
public/test/core/time_series_specs.js
+3
-3
No files found.
public/app/core/time_series2.ts
View file @
8a0d5aa3
...
@@ -173,8 +173,8 @@ export default class TimeSeries {
...
@@ -173,8 +173,8 @@ export default class TimeSeries {
isMsResolutionNeeded
()
{
isMsResolutionNeeded
()
{
for
(
var
i
=
0
;
i
<
this
.
datapoints
.
length
;
i
++
)
{
for
(
var
i
=
0
;
i
<
this
.
datapoints
.
length
;
i
++
)
{
if
(
this
.
datapoints
[
i
][
0
]
!==
null
)
{
if
(
this
.
datapoints
[
i
][
1
]
!==
null
)
{
var
timestamp
=
this
.
datapoints
[
i
][
0
].
toString
();
var
timestamp
=
this
.
datapoints
[
i
][
1
].
toString
();
if
(
timestamp
.
length
===
13
&&
(
timestamp
%
1000
)
!==
0
)
{
if
(
timestamp
.
length
===
13
&&
(
timestamp
%
1000
)
!==
0
)
{
return
true
;
return
true
;
}
}
...
...
public/app/plugins/panel/graph/specs/graph_ctrl_specs.ts
View file @
8a0d5aa3
...
@@ -22,8 +22,8 @@ describe('GraphCtrl', function() {
...
@@ -22,8 +22,8 @@ describe('GraphCtrl', function() {
describe
(
'msResolution with second resolution timestamps'
,
function
()
{
describe
(
'msResolution with second resolution timestamps'
,
function
()
{
beforeEach
(
function
()
{
beforeEach
(
function
()
{
var
data
=
[
var
data
=
[
{
target
:
'test.cpu1'
,
datapoints
:
[[
1234567890
,
45
],
[
1234567899
,
60
]]},
{
target
:
'test.cpu1'
,
datapoints
:
[[
45
,
1234567890
],
[
60
,
1234567899
]]},
{
target
:
'test.cpu2'
,
datapoints
:
[[
1236547890
,
55
],
[
1234456709
,
90
]]}
{
target
:
'test.cpu2'
,
datapoints
:
[[
55
,
1236547890
],
[
90
,
1234456709
]]}
];
];
ctx
.
ctrl
.
panel
.
tooltip
.
msResolution
=
false
;
ctx
.
ctrl
.
panel
.
tooltip
.
msResolution
=
false
;
ctx
.
ctrl
.
onDataReceived
(
data
);
ctx
.
ctrl
.
onDataReceived
(
data
);
...
@@ -37,8 +37,8 @@ describe('GraphCtrl', function() {
...
@@ -37,8 +37,8 @@ describe('GraphCtrl', function() {
describe
(
'msResolution with millisecond resolution timestamps'
,
function
()
{
describe
(
'msResolution with millisecond resolution timestamps'
,
function
()
{
beforeEach
(
function
()
{
beforeEach
(
function
()
{
var
data
=
[
var
data
=
[
{
target
:
'test.cpu1'
,
datapoints
:
[[
1234567890000
,
45
],
[
1234567899000
,
6
0
]]},
{
target
:
'test.cpu1'
,
datapoints
:
[[
45
,
1234567890000
],
[
60
,
123456789900
0
]]},
{
target
:
'test.cpu2'
,
datapoints
:
[[
1236547890001
,
55
],
[
1234456709000
,
9
0
]]}
{
target
:
'test.cpu2'
,
datapoints
:
[[
55
,
1236547890001
],
[
90
,
123445670900
0
]]}
];
];
ctx
.
ctrl
.
panel
.
tooltip
.
msResolution
=
false
;
ctx
.
ctrl
.
panel
.
tooltip
.
msResolution
=
false
;
ctx
.
ctrl
.
onDataReceived
(
data
);
ctx
.
ctrl
.
onDataReceived
(
data
);
...
@@ -52,8 +52,8 @@ describe('GraphCtrl', function() {
...
@@ -52,8 +52,8 @@ describe('GraphCtrl', function() {
describe
(
'msResolution with millisecond resolution timestamps but with trailing zeroes'
,
function
()
{
describe
(
'msResolution with millisecond resolution timestamps but with trailing zeroes'
,
function
()
{
beforeEach
(
function
()
{
beforeEach
(
function
()
{
var
data
=
[
var
data
=
[
{
target
:
'test.cpu1'
,
datapoints
:
[[
1234567890000
,
45
],
[
1234567899000
,
6
0
]]},
{
target
:
'test.cpu1'
,
datapoints
:
[[
45
,
1234567890000
],
[
60
,
123456789900
0
]]},
{
target
:
'test.cpu2'
,
datapoints
:
[[
1236547890000
,
55
],
[
1234456709000
,
9
0
]]}
{
target
:
'test.cpu2'
,
datapoints
:
[[
55
,
1236547890000
],
[
90
,
123445670900
0
]]}
];
];
ctx
.
ctrl
.
panel
.
tooltip
.
msResolution
=
false
;
ctx
.
ctrl
.
panel
.
tooltip
.
msResolution
=
false
;
ctx
.
ctrl
.
onDataReceived
(
data
);
ctx
.
ctrl
.
onDataReceived
(
data
);
...
@@ -67,9 +67,9 @@ describe('GraphCtrl', function() {
...
@@ -67,9 +67,9 @@ describe('GraphCtrl', function() {
describe
(
'msResolution with millisecond resolution timestamps in one of the series'
,
function
()
{
describe
(
'msResolution with millisecond resolution timestamps in one of the series'
,
function
()
{
beforeEach
(
function
()
{
beforeEach
(
function
()
{
var
data
=
[
var
data
=
[
{
target
:
'test.cpu1'
,
datapoints
:
[[
1234567890000
,
45
],
[
1234567899000
,
6
0
]]},
{
target
:
'test.cpu1'
,
datapoints
:
[[
45
,
1234567890000
],
[
60
,
123456789900
0
]]},
{
target
:
'test.cpu2'
,
datapoints
:
[[
1236547890010
,
55
],
[
1234456709000
,
9
0
]]},
{
target
:
'test.cpu2'
,
datapoints
:
[[
55
,
1236547890010
],
[
90
,
123445670900
0
]]},
{
target
:
'test.cpu3'
,
datapoints
:
[[
1236547890000
,
65
],
[
1234456709000
,
12
0
]]}
{
target
:
'test.cpu3'
,
datapoints
:
[[
65
,
1236547890000
],
[
120
,
123445670900
0
]]}
];
];
ctx
.
ctrl
.
panel
.
tooltip
.
msResolution
=
false
;
ctx
.
ctrl
.
panel
.
tooltip
.
msResolution
=
false
;
ctx
.
ctrl
.
onDataReceived
(
data
);
ctx
.
ctrl
.
onDataReceived
(
data
);
...
...
public/test/core/time_series_specs.js
View file @
8a0d5aa3
...
@@ -56,7 +56,7 @@ define([
...
@@ -56,7 +56,7 @@ define([
});
});
});
});
describe
(
'can detect if serie contains ms precision'
,
function
()
{
describe
(
'can detect if serie
s
contains ms precision'
,
function
()
{
var
fakedata
;
var
fakedata
;
beforeEach
(
function
()
{
beforeEach
(
function
()
{
...
@@ -64,13 +64,13 @@ define([
...
@@ -64,13 +64,13 @@ define([
});
});
it
(
'missing datapoint with ms precision'
,
function
()
{
it
(
'missing datapoint with ms precision'
,
function
()
{
fakedata
.
datapoints
[
0
]
=
[
1
234567890000
,
1337
];
fakedata
.
datapoints
[
0
]
=
[
1
337
,
1234567890000
];
series
=
new
TimeSeries
(
fakedata
);
series
=
new
TimeSeries
(
fakedata
);
expect
(
series
.
isMsResolutionNeeded
()).
to
.
be
(
false
);
expect
(
series
.
isMsResolutionNeeded
()).
to
.
be
(
false
);
});
});
it
(
'contains datapoint with ms precision'
,
function
()
{
it
(
'contains datapoint with ms precision'
,
function
()
{
fakedata
.
datapoints
[
0
]
=
[
1
236547890001
,
1337
];
fakedata
.
datapoints
[
0
]
=
[
1
337
,
1236547890001
];
series
=
new
TimeSeries
(
fakedata
);
series
=
new
TimeSeries
(
fakedata
);
expect
(
series
.
isMsResolutionNeeded
()).
to
.
be
(
true
);
expect
(
series
.
isMsResolutionNeeded
()).
to
.
be
(
true
);
});
});
...
...
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