Commit 554e844e authored by Frédéric Caplette's avatar Frédéric Caplette

Merge branch 'jivanvl-fix-shared-runner-usage-scale' into 'master'

Convert seconds to minutes for the shared runner usage chart

See merge request gitlab-org/gitlab!83048
parents e8015860 2d622631
...@@ -7,6 +7,8 @@ import { convertToGraphQLId } from '~/graphql_shared/utils'; ...@@ -7,6 +7,8 @@ import { convertToGraphQLId } from '~/graphql_shared/utils';
import { s__, __ } from '~/locale'; import { s__, __ } from '~/locale';
import getCiMinutesUsageByNamespace from '../graphql/ci_minutes.query.graphql'; import getCiMinutesUsageByNamespace from '../graphql/ci_minutes.query.graphql';
const timeFormatter = (val) => val;
export default { export default {
components: { components: {
GlIcon, GlIcon,
...@@ -55,6 +57,9 @@ export default { ...@@ -55,6 +57,9 @@ export default {
}, },
yAxis: { yAxis: {
name: this.$options.i18n.yAxisLabel, name: this.$options.i18n.yAxisLabel,
axisLabel: {
formatter: timeFormatter,
},
}, },
}; };
}, },
...@@ -64,7 +69,10 @@ export default { ...@@ -64,7 +69,10 @@ export default {
.sort((a, b) => { .sort((a, b) => {
return new Date(a.monthIso8601) - new Date(b.monthIso8601); return new Date(a.monthIso8601) - new Date(b.monthIso8601);
}) })
.map((cur) => [formatDate(cur.monthIso8601, 'mmm yyyy'), cur.sharedRunnersDuration]); .map((cur) => [
formatDate(cur.monthIso8601, 'mmm yyyy'),
parseFloat((cur.sharedRunnersDuration / 60).toFixed(2)),
]);
}, },
isDataEmpty() { isDataEmpty() {
return this.minutesUsageDataByMonth.length === 0; return this.minutesUsageDataByMonth.length === 0;
......
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