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
98e756e2
Commit
98e756e2
authored
Mar 01, 2016
by
bergquist
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(tooltip): msdetection can now handle null data points
parent
b6ac0860
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
5 deletions
+25
-5
public/app/core/time_series2.ts
+5
-3
public/test/core/time_series_specs.js
+20
-2
No files found.
public/app/core/time_series2.ts
View file @
98e756e2
...
@@ -171,9 +171,11 @@ export default class TimeSeries {
...
@@ -171,9 +171,11 @@ export default class TimeSeries {
isMsResolutionNeeded
()
{
isMsResolutionNeeded
()
{
for
(
var
i
=
0
;
i
<
this
.
datapoints
.
length
;
i
++
)
{
for
(
var
i
=
0
;
i
<
this
.
datapoints
.
length
;
i
++
)
{
var
timestamp
=
this
.
datapoints
[
i
][
0
].
toString
();
if
(
this
.
datapoints
[
i
][
0
]
!==
null
)
{
if
(
timestamp
.
length
===
13
&&
(
timestamp
%
1000
)
!==
0
)
{
var
timestamp
=
this
.
datapoints
[
i
][
0
].
toString
();
return
true
;
if
(
timestamp
.
length
===
13
&&
(
timestamp
%
1000
)
!==
0
)
{
return
true
;
}
}
}
}
}
return
false
;
return
false
;
...
...
public/test/core/time_series_specs.js
View file @
98e756e2
...
@@ -56,6 +56,26 @@ define([
...
@@ -56,6 +56,26 @@ define([
});
});
});
});
describe
(
'can detect if serie contains ms precision'
,
function
()
{
var
fakedata
;
beforeEach
(
function
()
{
fakedata
=
testData
;
});
it
(
'missing datapoint with ms precision'
,
function
()
{
fakedata
.
datapoints
[
0
]
=
[
1234567890000
,
1337
];
series
=
new
TimeSeries
(
fakedata
);
expect
(
series
.
isMsResolutionNeeded
()).
to
.
be
(
false
);
});
it
(
'contains datapoint with ms precision'
,
function
()
{
fakedata
.
datapoints
[
0
]
=
[
1236547890001
,
1337
];
series
=
new
TimeSeries
(
fakedata
);
expect
(
series
.
isMsResolutionNeeded
()).
to
.
be
(
true
);
});
});
describe
(
'series overrides'
,
function
()
{
describe
(
'series overrides'
,
function
()
{
var
series
;
var
series
;
beforeEach
(
function
()
{
beforeEach
(
function
()
{
...
@@ -148,7 +168,5 @@ define([
...
@@ -148,7 +168,5 @@ define([
});
});
});
});
});
});
});
});
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