diff options
author | Mike Greiling <mike@pixelcog.com> | 2017-10-06 23:29:32 +0300 |
---|---|---|
committer | Mike Greiling <mike@pixelcog.com> | 2017-10-06 23:29:32 +0300 |
commit | e3fe48b85dc07b135180f8ec54db95537f794fdc (patch) | |
tree | da0a159ee9b500351619319da638fa99025a4b88 /app/assets | |
parent | 2cf5dca8f80cdefeb8932bf80417f52f289668c8 (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.js | 4 |
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) |