|
|
@@ -901,34 +901,35 @@ func TestAllocationSet_ComputeIdleAllocations(t *testing.T) {
|
|
|
// NOTE: we're re-using generateAllocationSet so this has to line up with
|
|
|
// the allocated node costs from that function. See table above.
|
|
|
|
|
|
- // | Hierarchy | Cost | CPU | RAM | GPU |
|
|
|
- // +-----------------------------------------+------+------+------+------+
|
|
|
+ // | Hierarchy | Cost | CPU | RAM | GPU | Adjustment |
|
|
|
+ // +-----------------------------------------+------+------+------+------+------------+
|
|
|
// cluster1:
|
|
|
- // nodes 100.00 50.00 40.00 10.00
|
|
|
- // +-----------------------------------------+------+------+------+------+
|
|
|
- // cluster1 subtotal 100.00 50.00 40.00 10.00
|
|
|
- // +-----------------------------------------+------+------+------+------+
|
|
|
- // cluster1 allocated 48.00 6.00 16.00 6.00
|
|
|
- // +-----------------------------------------+------+------+------+------+
|
|
|
- // cluster1 idle 72.00 44.00 24.00 4.00
|
|
|
- // +-----------------------------------------+------+------+------+------+
|
|
|
+ // nodes 100.00 55.00 44.00 11.00 -10.00
|
|
|
+ // +-----------------------------------------+------+------+------+------+------------+
|
|
|
+ // cluster1 subtotal 100.00 50.00 40.00 10.00 -10.00
|
|
|
+ // +-----------------------------------------+------+------+------+------+------------+
|
|
|
+ // cluster1 allocated 48.00 6.00 16.00 6.00 0.00
|
|
|
+ // +-----------------------------------------+------+------+------+------+------------+
|
|
|
+ // cluster1 idle 72.00 44.00 24.00 4.00 0.00
|
|
|
+ // +-----------------------------------------+------+------+------+------+------------+
|
|
|
// cluster2:
|
|
|
- // node1 35.00 20.00 15.00 0.00
|
|
|
- // node2 35.00 20.00 15.00 0.00
|
|
|
- // node3 30.00 10.00 10.00 10.00
|
|
|
+ // node1 35.00 20.00 15.00 0.00 0.00
|
|
|
+ // node2 35.00 20.00 15.00 0.00 0.00
|
|
|
+ // node3 30.00 10.00 10.00 10.00 0.00
|
|
|
// (disks should not matter for idle)
|
|
|
- // +-----------------------------------------+------+------+------+------+
|
|
|
- // cluster2 subtotal 100.00 50.00 40.00 10.00
|
|
|
- // +-----------------------------------------+------+------+------+------+
|
|
|
- // cluster2 allocated 28.00 6.00 6.00 6.00
|
|
|
- // +-----------------------------------------+------+------+------+------+
|
|
|
- // cluster2 idle 82.00 44.00 34.00 4.00
|
|
|
- // +-----------------------------------------+------+------+------+------+
|
|
|
+ // +-----------------------------------------+------+------+------+------+------------+
|
|
|
+ // cluster2 subtotal 100.00 50.00 40.00 10.00 0.00
|
|
|
+ // +-----------------------------------------+------+------+------+------+------------+
|
|
|
+ // cluster2 allocated 28.00 6.00 6.00 6.00 0.00
|
|
|
+ // +-----------------------------------------+------+------+------+------+------------+
|
|
|
+ // cluster2 idle 82.00 44.00 34.00 4.00 0.00
|
|
|
+ // +-----------------------------------------+------+------+------+------+------------+
|
|
|
|
|
|
cluster1Nodes := NewNode("", "cluster1", "", start, end, NewWindow(&start, &end))
|
|
|
- cluster1Nodes.CPUCost = 50.0
|
|
|
- cluster1Nodes.RAMCost = 40.0
|
|
|
- cluster1Nodes.GPUCost = 10.0
|
|
|
+ cluster1Nodes.CPUCost = 55.0
|
|
|
+ cluster1Nodes.RAMCost = 44.0
|
|
|
+ cluster1Nodes.GPUCost = 11.0
|
|
|
+ cluster1Nodes.adjustment = -10.00
|
|
|
|
|
|
cluster2Node1 := NewNode("node1", "cluster2", "node1", start, end, NewWindow(&start, &end))
|
|
|
cluster2Node1.CPUCost = 20.0
|