Skip to content

Commit

Permalink
Add a key to the alloc table on the task group detail page
Browse files Browse the repository at this point in the history
Adding keys tells Ember to rerender matching entries instead of
destroying and recreating.

Without this key, every time the allocation collection changes, every
allocation row gets destroyed and recreated.

This happens a lot, since each allocation needs to be reloaded which
dirties the collection.

Since allocation rows fetch stats on init, each of these many many
renders results in a stats request.

By using key and rerendering matching records, this all goes away. Since
the rows aren't being destroyed and recreated, the init stats request
isn't being made overnumerously.
  • Loading branch information
DingoEatingFuzz committed Jun 19, 2020
1 parent a1a140c commit 6dfca71
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ui/app/templates/jobs/job/task-group.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@
<th>CPU</th>
<th>Memory</th>
</t.head>
<t.body as |row|>
<t.body @key="model.id" as |row|>
<AllocationRow @data-test-allocation={{row.model.id}} @allocation={{row.model}} @context="taskGroup" @onClick={{action "gotoAllocation" row.model}} />
</t.body>
</ListTable>
Expand Down

0 comments on commit 6dfca71

Please sign in to comment.