From 7a9a208c890754914220288fca51fcefee04f43c Mon Sep 17 00:00:00 2001 From: Michael Lange Date: Wed, 27 Jan 2021 10:24:03 -0800 Subject: [PATCH] Adjust the no-association-lines logic 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. --- ui/app/components/topo-viz.js | 4 ++-- ui/tests/integration/components/topo-viz-test.js | 9 +++++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/ui/app/components/topo-viz.js b/ui/app/components/topo-viz.js index e46f6b10e..9c9ac0fab 100644 --- a/ui/app/components/topo-viz.js +++ b/ui/app/components/topo-viz.js @@ -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 = []; diff --git a/ui/tests/integration/components/topo-viz-test.js b/ui/tests/integration/components/topo-viz-test.js index 1ec288f35..abc0b7a52 100644 --- a/ui/tests/integration/components/topo-viz-test.js +++ b/ui/tests/integration/components/topo-viz-test.js @@ -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),