diff --git a/ui/app/components/allocation-stat.js b/ui/app/components/allocation-stat.js index 22c7a42c8..b53531070 100644 --- a/ui/app/components/allocation-stat.js +++ b/ui/app/components/allocation-stat.js @@ -1,7 +1,7 @@ import Component from '@ember/component'; import { computed } from '@ember/object'; import { alias } from '@ember/object/computed'; -import { formatScheduledBytes, formatBytes } from 'nomad-ui/utils/units'; +import { formatBytes, formatHertz } from 'nomad-ui/utils/units'; import { tagName } from '@ember-decorators/component'; import classic from 'ember-classic-decorator'; @@ -36,13 +36,14 @@ export default class AllocationStat extends Component { get formattedStat() { if (!this.stat) return undefined; if (this.metric === 'memory') return formatBytes(this.stat.used); - return this.stat.used; + if (this.metric === 'cpu') return formatHertz(this.stat.used, 'MHz'); + return undefined; } @computed('metric', 'statsTracker.{reservedMemory,reservedCPU}') get formattedReserved() { if (this.metric === 'memory') return formatBytes(this.statsTracker.reservedMemory, 'MiB'); - if (this.metric === 'cpu') return `${this.statsTracker.reservedCPU} MHz`; + if (this.metric === 'cpu') return formatHertz(this.statsTracker.reservedCPU, 'MHz'); return undefined; } } diff --git a/ui/app/components/primary-metric/allocation.hbs b/ui/app/components/primary-metric/allocation.hbs index 31e8060ce..ed69fc077 100644 --- a/ui/app/components/primary-metric/allocation.hbs +++ b/ui/app/components/primary-metric/allocation.hbs @@ -18,7 +18,7 @@