Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Gabriel Silva Vinha
codespeed
Commits
cccf637a
Unverified
Commit
cccf637a
authored
Dec 31, 2017
by
Miquel Torres
Committed by
GitHub
Dec 31, 2017
Browse files
Merge pull request #233 from smarr/fixes/timeline-freeze-on-missing-data
Ensure missing data points don’t lead to infinite loop
parents
7b5423a6
48052fc0
Changes
1
Hide whitespace changes
Inline
Side-by-side
codespeed/static/js/timeline.js
View file @
cccf637a
...
...
@@ -95,10 +95,20 @@ function getHighlighterConfig(median) {
}
}
function
determineSignificantDigits
(
value
,
digits
)
{
var
val
=
Math
.
abs
(
value
);
while
(
val
<
1
)
{
val
*=
10
;
digits
++
;
}
return
digits
;
}
function
renderPlot
(
data
)
{
var
plotdata
=
[],
series
=
[],
la
st
v
alue
s
=
[];
//hopefully the smallest values for determining significant digits.
smalle
st
V
alue
=
Number
.
MAX_SAFE_INTEGER
;
//
hopefully the smallest values for determining significant digits.
seriesindex
=
[];
var
hiddenSeries
=
0
;
var
median
=
data
[
'
data_type
'
]
===
'
M
'
;
...
...
@@ -154,17 +164,17 @@ function renderPlot(data) {
series
.
push
(
seriesConfig
);
seriesindex
.
push
(
exe_id
);
plotdata
.
push
(
data
.
branches
[
branch
][
exe_id
]);
lastvalues
.
push
(
data
.
branches
[
branch
][
exe_id
][
0
][
1
]);
}
//determine significant digits
var
digits
=
2
;
var
value
=
Math
.
min
.
apply
(
Math
,
lastvalues
);
if
(
value
!==
0
)
{
while
(
value
<
1
)
{
value
*=
10
;
digits
++
;
// determine smallest non-negative value in lastvalues
// (missing values can be represented as -1)
var
val
=
data
.
branches
[
branch
][
exe_id
][
0
][
1
];
if
(
val
>
0
&&
val
<
smallestValue
)
{
smallestValue
=
val
;
}
}
var
digits
=
determineSignificantDigits
(
smallestValue
,
2
);
$
(
"
#plotgrid
"
).
html
(
'
<div id="plot"></div><div id="plotdescription"></div>
'
);
if
(
data
.
benchmark_description
)
{
...
...
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