gitlab-org--gitlab-foss/spec/frontend/serverless/utils.js

21 lines
556 B
JavaScript
Raw Normal View History

2019-04-05 22:02:39 -04:00
export const adjustMetricQuery = data => {
const updatedMetric = data.metrics;
const queries = data.metrics.queries.map(query => ({
...query,
result: query.result.map(result => ({
...result,
values: result.values.map(([timestamp, value]) => ({
time: new Date(timestamp * 1000).toISOString(),
value: Number(value),
})),
})),
}));
updatedMetric.queries = queries;
return updatedMetric;
};
// prevent babel-plugin-rewire from generating an invalid default during karma tests
export default () => {};