From 5af31d6eb0b1bb7b872c5c520cb26d7c7dd5110c Mon Sep 17 00:00:00 2001 From: Mike Greiling Date: Sun, 5 Nov 2017 22:46:15 -0600 Subject: add track information to data legend --- .../javascripts/monitoring/utils/multiple_time_series.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/app/assets/javascripts/monitoring/utils/multiple_time_series.js b/app/assets/javascripts/monitoring/utils/multiple_time_series.js index 9122c6e1e1e..97f32795d5c 100644 --- a/app/assets/javascripts/monitoring/utils/multiple_time_series.js +++ b/app/assets/javascripts/monitoring/utils/multiple_time_series.js @@ -65,9 +65,9 @@ function queryTimeSeries(query, graphWidth, graphHeight, graphHeightOffset, maxV const timeSeriesMetricLabel = timeSeries.metric[Object.keys(timeSeries.metric)[0]]; const seriesCustomizationData = query.series != null && - _.findWhere(query.series[0].when, - { value: timeSeriesMetricLabel }); - if (seriesCustomizationData != null) { + _.findWhere(query.series[0].when, { value: timeSeriesMetricLabel }); + + if (seriesCustomizationData) { metricTag = seriesCustomizationData.value || timeSeriesMetricLabel; [lineColor, areaColor] = pickColor(seriesCustomizationData.color); } else { @@ -75,6 +75,10 @@ function queryTimeSeries(query, graphWidth, graphHeight, graphHeightOffset, maxV [lineColor, areaColor] = pickColor(); } + if (query.track) { + metricTag += ` - track: ${query.track}`; + } + return { linePath: lineFunction(timeSeries.values), areaPath: areaFunction(timeSeries.values), -- cgit v1.2.1