use of com.netflix.simianarmy.tunable.TunableInstanceGroup in project SimianArmy by Netflix.
the class ASGChaosCrawler method getInstanceGroup.
/**
* Returns the desired InstanceGroup. If there is no set aggression coefficient, then it
* returns the basic impl, otherwise it returns the tunable impl.
* @param asg The autoscaling group
* @return The appropriate {@link InstanceGroup}
*/
protected InstanceGroup getInstanceGroup(AutoScalingGroup asg, double aggressionCoefficient) {
InstanceGroup instanceGroup;
// if coefficient is 1 then the BasicInstanceGroup is fine, otherwise use Tunable
if (aggressionCoefficient == 1.0) {
instanceGroup = new BasicInstanceGroup(asg.getAutoScalingGroupName(), Types.ASG, awsClient.region(), asg.getTags());
} else {
TunableInstanceGroup tunable = new TunableInstanceGroup(asg.getAutoScalingGroupName(), Types.ASG, awsClient.region(), asg.getTags());
tunable.setAggressionCoefficient(aggressionCoefficient);
instanceGroup = tunable;
}
return instanceGroup;
}
use of com.netflix.simianarmy.tunable.TunableInstanceGroup in project SimianArmy by Netflix.
the class TestASGChaosCrawler method testGetInstanceGroup_tunable.
@Test
public void testGetInstanceGroup_tunable() {
AutoScalingGroup asg = mkAsg("asg1", "i-123456789012345670");
InstanceGroup group = crawler.getInstanceGroup(asg, 2.0);
Assert.assertTrue((group instanceof TunableInstanceGroup));
}
use of com.netflix.simianarmy.tunable.TunableInstanceGroup in project SimianArmy by Netflix.
the class TestASGChaosCrawler method testGetInstanceGroup_basic.
@Test
public void testGetInstanceGroup_basic() {
AutoScalingGroup asg = mkAsg("asg1", "i-123456789012345670");
InstanceGroup group = crawler.getInstanceGroup(asg, 1.0);
Assert.assertTrue((group instanceof BasicInstanceGroup));
Assert.assertFalse((group instanceof TunableInstanceGroup));
}
Aggregations