Commit 4ea9c9b6 authored by Jose Ivan Vargas's avatar Jose Ivan Vargas

Converted the dates for each time series on the store

parent bd82e61f
......@@ -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 => ({
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],
}));
currentMetrics[key].queries[0].result[0].values = literalMetrics;
}
return {
metric: series.metric,
values: convertedValues,
};
});
metricsRow.push(currentMetrics[key]);
if (index % 2 === 0) {
availableMetrics.push(metricsRow);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment