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
6495ba15
Commit
6495ba15
authored
Nov 10, 2016
by
Ben RUBSON
Committed by
Torkel Ödegaard
Nov 10, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Correct timeStep in case of missing values (#6526)
* Correct timeStep in case of missing values * Comment
parent
24433263
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
4 deletions
+9
-4
public/app/core/time_series2.ts
+9
-4
No files found.
public/app/core/time_series2.ts
View file @
6495ba15
...
@@ -115,6 +115,15 @@ export default class TimeSeries {
...
@@ -115,6 +115,15 @@ export default class TimeSeries {
currentValue
=
this
.
datapoints
[
i
][
0
];
currentValue
=
this
.
datapoints
[
i
][
0
];
currentTime
=
this
.
datapoints
[
i
][
1
];
currentTime
=
this
.
datapoints
[
i
][
1
];
// Due to missing values we could have different timeStep all along the series
// so we have to find the minimum one (could occur with aggregators such as ZimSum)
if
(
i
>
0
)
{
var
previousTime
=
this
.
datapoints
[
i
-
1
][
1
];
if
(
!
this
.
stats
.
timeStep
||
currentTime
-
previousTime
<
this
.
stats
.
timeStep
)
{
this
.
stats
.
timeStep
=
currentTime
-
previousTime
;
}
}
if
(
currentValue
===
null
)
{
if
(
currentValue
===
null
)
{
if
(
ignoreNulls
)
{
continue
;
}
if
(
ignoreNulls
)
{
continue
;
}
if
(
nullAsZero
)
{
if
(
nullAsZero
)
{
...
@@ -145,10 +154,6 @@ export default class TimeSeries {
...
@@ -145,10 +154,6 @@ export default class TimeSeries {
result
.
push
([
currentTime
,
currentValue
]);
result
.
push
([
currentTime
,
currentValue
]);
}
}
if
(
this
.
datapoints
.
length
>=
2
)
{
this
.
stats
.
timeStep
=
this
.
datapoints
[
1
][
1
]
-
this
.
datapoints
[
0
][
1
];
}
if
(
this
.
stats
.
max
===
-
Number
.
MAX_VALUE
)
{
this
.
stats
.
max
=
null
;
}
if
(
this
.
stats
.
max
===
-
Number
.
MAX_VALUE
)
{
this
.
stats
.
max
=
null
;
}
if
(
this
.
stats
.
min
===
Number
.
MAX_VALUE
)
{
this
.
stats
.
min
=
null
;
}
if
(
this
.
stats
.
min
===
Number
.
MAX_VALUE
)
{
this
.
stats
.
min
=
null
;
}
...
...
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