Skip to content

Commit

Permalink
Adjust the no-association-lines logic
Browse files Browse the repository at this point in the history
On very small clusters, the node count heuristic is impractical and
leads to confusion. By additionally requiring 10+ sibling allocs, the
lines will be shown more often.
  • Loading branch information
DingoEatingFuzz committed Jan 27, 2021
1 parent 494b90c commit ac758a7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ui/app/components/topo-viz.js
Original file line number Diff line number Diff line change
Expand Up @@ -220,8 +220,8 @@ export default class TopoViz extends Component {
});
}

// Only show the lines if the selected allocations are sparse (low count relative to the client count).
if (newAllocations.length < this.args.nodes.length * 0.75) {
// Only show the lines if the selected allocations are sparse (low count relative to the client count or low count generally).
if (newAllocations.length < 10 || newAllocations.length < this.args.nodes.length * 0.75) {
this.computedActiveEdges();
} else {
this.activeEdges = [];
Expand Down
9 changes: 9 additions & 0 deletions ui/tests/integration/components/topo-viz-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,17 @@ module('Integration | Component | TopoViz', function(hooks) {
this.setProperties({
nodes: [node('dc1', 'node0', 1000, 500), node('dc1', 'node1', 1000, 500)],
allocations: [
// There need to be at least 10 sibling allocations to trigger this behavior
alloc('node0', 'job1', 'group', 100, 100),
alloc('node0', 'job1', 'group', 100, 100),
alloc('node0', 'job1', 'group', 100, 100),
alloc('node0', 'job1', 'group', 100, 100),
alloc('node0', 'job1', 'group', 100, 100),
alloc('node0', 'job1', 'group', 100, 100),
alloc('node1', 'job1', 'group', 100, 100),
alloc('node1', 'job1', 'group', 100, 100),
alloc('node1', 'job1', 'group', 100, 100),
alloc('node1', 'job1', 'group', 100, 100),
alloc('node1', 'job1', 'group', 100, 100),
alloc('node1', 'job1', 'group', 100, 100),
alloc('node0', 'job1', 'groupTwo', 100, 100),
Expand Down

0 comments on commit ac758a7

Please sign in to comment.