Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Greiling <mike@pixelcog.com>2017-10-06 23:29:32 +0300
committerMike Greiling <mike@pixelcog.com>2017-10-06 23:29:32 +0300
commite3fe48b85dc07b135180f8ec54db95537f794fdc (patch)
treeda0a159ee9b500351619319da638fa99025a4b88 /app/assets
parent2cf5dca8f80cdefeb8932bf80417f52f289668c8 (diff)
allow prometheus graphs to handle non-congiuous paths (with NaN, +Inf, and -Inf)
Diffstat (limited to 'app/assets')
-rw-r--r--app/assets/javascripts/monitoring/utils/multiple_time_series.js4
1 files changed, 4 insertions, 0 deletions
diff --git a/app/assets/javascripts/monitoring/utils/multiple_time_series.js b/app/assets/javascripts/monitoring/utils/multiple_time_series.js
index 3cbe06d8fd6..65eec0d8d02 100644
--- a/app/assets/javascripts/monitoring/utils/multiple_time_series.js
+++ b/app/assets/javascripts/monitoring/utils/multiple_time_series.js
@@ -56,12 +56,16 @@ export default function createTimeSeries(queryData, graphWidth, graphHeight, gra
timeSeriesScaleX.ticks(d3.time.minute, 60);
timeSeriesScaleY.domain([0, maxValueFromSeries.maxValue]);
+ const defined = d => !isNaN(d.value) && d.value != null;
+
const lineFunction = d3.svg.line()
+ .defined(defined)
.interpolate('linear')
.x(d => timeSeriesScaleX(d.time))
.y(d => timeSeriesScaleY(d.value));
const areaFunction = d3.svg.area()
+ .defined(defined)
.interpolate('linear')
.x(d => timeSeriesScaleX(d.time))
.y0(graphHeight - graphHeightOffset)