diff options
author | Jose Ivan Vargas <jvargas@gitlab.com> | 2017-07-28 10:32:02 -0500 |
---|---|---|
committer | Jose Ivan Vargas <jvargas@gitlab.com> | 2017-08-30 18:27:24 -0500 |
commit | 4ea9c9b687719012f43bf42406095f5137c18cec (patch) | |
tree | b2966391e483d47640627ac4922bcc285bdd6dbb /app/assets/javascripts/monitoring | |
parent | bd82e61f910ce36a1c3ece4a680706db2cf05a2d (diff) | |
download | gitlab-ce-4ea9c9b687719012f43bf42406095f5137c18cec.tar.gz |
Converted the dates for each time series on the store
Diffstat (limited to 'app/assets/javascripts/monitoring')
-rw-r--r-- | app/assets/javascripts/monitoring/stores/monitoring_store.js | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/app/assets/javascripts/monitoring/stores/monitoring_store.js b/app/assets/javascripts/monitoring/stores/monitoring_store.js index 737c964f12e..541c8e7dd46 100644 --- a/app/assets/javascripts/monitoring/stores/monitoring_store.js +++ b/app/assets/javascripts/monitoring/stores/monitoring_store.js @@ -13,13 +13,21 @@ class MonitoringStore { let metricsRow = []; let index = 1; Object.keys(currentMetrics).forEach((key) => { - const metricValues = currentMetrics[key].queries[0].result[0].values; + const metricValues = currentMetrics[key].queries[0].result; if (metricValues != null) { - const literalMetrics = metricValues.map(metric => ({ - time: new Date(metric[0] * 1000), - value: metric[1], - })); - currentMetrics[key].queries[0].result[0].values = literalMetrics; + currentMetrics[key].queries[0].result = metricValues.map((series) => { + let convertedValues = []; + if (series != null) { + convertedValues = series.values.map(metric => ({ + time: new Date(metric[0] * 1000), + value: metric[1], + })); + } + return { + metric: series.metric, + values: convertedValues, + }; + }); metricsRow.push(currentMetrics[key]); if (index % 2 === 0) { availableMetrics.push(metricsRow); |