Skip to content

Commit

Permalink
Remove memory max from task group details ribbon
Browse files Browse the repository at this point in the history
This is a reversion from #10459, more background here:
#10268 (comment)
  • Loading branch information
backspace committed May 18, 2021
1 parent 293b741 commit 540392e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 15 deletions.
8 changes: 1 addition & 7 deletions ui/app/templates/jobs/job/task-group.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,7 @@

<span class="pair" data-test-task-group-tasks><span class="term"># Tasks</span> {{this.model.tasks.length}}</span>
<span class="pair" data-test-task-group-cpu><span class="term">Reserved CPU</span> {{format-scheduled-hertz this.model.reservedCPU}}</span>
<span class="pair" data-test-task-group-mem>
<span class="term">Reserved Memory</span>
{{format-scheduled-bytes this.model.reservedMemory start="MiB"}}
{{#if (gt this.model.reservedMemoryMax this.model.reservedMemory)}}
({{format-scheduled-bytes this.model.reservedMemoryMax start="MiB"}} Max)
{{/if}}
</span>
<span class="pair" data-test-task-group-mem><span class="term">Reserved Memory</span> {{format-scheduled-bytes this.model.reservedMemory start="MiB"}}</span>
<span class="pair" data-test-task-group-disk><span class="term">Reserved Disk</span> {{format-scheduled-bytes this.model.reservedEphemeralDisk start="MiB"}}</span>
{{#if this.model.scaling}}
<span class="pair" data-test-task-group-min><span class="term">Count Range</span>
Expand Down
9 changes: 1 addition & 8 deletions ui/tests/acceptance/task-group-detail-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ module('Acceptance | task group detail', function(hooks) {
test('/jobs/:id/:task-group should list high-level metrics for the allocation', async function(assert) {
const totalCPU = tasks.mapBy('resources.CPU').reduce(sum, 0);
const totalMemory = tasks.mapBy('resources.MemoryMB').reduce(sum, 0);
const totalMemoryMax = tasks.map(t => t.resources.MemoryMaxMB || t.resources.MemoryMB).reduce(sum, 0);
const totalDisk = taskGroup.ephemeralDisk.SizeMB;

await TaskGroup.visit({ id: job.id, name: taskGroup.name });
Expand All @@ -94,15 +93,9 @@ module('Acceptance | task group detail', function(hooks) {
'Aggregated CPU reservation for all tasks'
);

let totalMemoryMaxAddendum = '';

if (totalMemoryMax > totalMemory) {
totalMemoryMaxAddendum = ` (${formatScheduledBytes(totalMemoryMax, 'MiB')} Max)`;
}

assert.equal(
TaskGroup.mem,
`Reserved Memory ${formatScheduledBytes(totalMemory, 'MiB')}${totalMemoryMaxAddendum}`,
`Reserved Memory ${formatScheduledBytes(totalMemory, 'MiB')}`,
'Aggregated Memory reservation for all tasks'
);
assert.equal(
Expand Down

0 comments on commit 540392e

Please sign in to comment.