Examples of InstanceGroup


Examples of com.netflix.simianarmy.chaos.ChaosCrawler.InstanceGroup

    public void testGetValueFromCfgWithDefault() {
        TestChaosMonkeyContext ctx = new TestChaosMonkeyContext("propertiesWithDefaults.properties");
        BasicChaosMonkey chaos = new BasicChaosMonkey(ctx);

        // named 1 has actual values in config
        InstanceGroup named1 = new BasicInstanceGroup("named1", GroupTypes.TYPE_A, "test-dev-1");

        // named 2 doesn't have values but it's group has values
        InstanceGroup named2 = new BasicInstanceGroup("named2", GroupTypes.TYPE_A, "test-dev-1");

        // named 3 doesn't have values and it's group doesn't have values
        InstanceGroup named3 = new BasicInstanceGroup("named3", GroupTypes.TYPE_B, "test-dev-1");

        Assert.assertEquals(chaos.getBoolFromCfgOrDefault(named1, "enabled", true), false);
        Assert.assertEquals(chaos.getNumFromCfgOrDefault(named1, "probability", 3.0), 1.1);
        Assert.assertEquals(chaos.getNumFromCfgOrDefault(named1, "maxTerminationsPerDay", 4.0), 2.1);
View Full Code Here

Examples of com.netflix.simianarmy.chaos.ChaosCrawler.InstanceGroup

    /**
     * {@inheritDoc}
     */
    @Override
    protected boolean isGroupEnabled(InstanceGroup group) {
        InstanceGroup noSuffixGroup = noSuffixInstanceGroup(group);
        return super.isGroupEnabled(noSuffixGroup);
    }
View Full Code Here

Examples of com.netflix.simianarmy.chaos.ChaosCrawler.InstanceGroup

    /**
     * {@inheritDoc}
     */
    @Override
    protected boolean isMaxTerminationCountExceeded(InstanceGroup group) {
        InstanceGroup noSuffixGroup = noSuffixInstanceGroup(group);
        return super.isMaxTerminationCountExceeded(noSuffixGroup);
    }
View Full Code Here

Examples of com.netflix.simianarmy.chaos.ChaosCrawler.InstanceGroup

    /**
     * {@inheritDoc}
     */
    @Override
    protected double getEffectiveProbability(InstanceGroup group) {
        InstanceGroup noSuffixGroup = noSuffixInstanceGroup(group);
        if (!super.isGroupEnabled(noSuffixGroup)) {
            return 0;
        }
        return getEffectiveProbabilityFromCfg(noSuffixGroup);
    }
View Full Code Here

Examples of com.netflix.simianarmy.chaos.ChaosCrawler.InstanceGroup

     * Returns the lastOptInTimeInMilliseconds parameter for a group omitting the
     * randomly generated suffix.
     */
    @Override
    protected long getLastOptInMilliseconds(InstanceGroup group) {
        InstanceGroup noSuffixGroup = noSuffixInstanceGroup(group);
        return super.getLastOptInMilliseconds(noSuffixGroup);
    }
View Full Code Here

Examples of com.netflix.simianarmy.chaos.ChaosCrawler.InstanceGroup

    /**
     * Handle email notifications for no suffix instance groups.
     */
    @Override
    public void sendTerminationNotification(InstanceGroup group, String instance, ChaosType chaosType) {
        InstanceGroup noSuffixGroup = noSuffixInstanceGroup(group);
        super.sendTerminationNotification(noSuffixGroup, instance, chaosType);
    }
View Full Code Here

Examples of com.netflix.simianarmy.chaos.ChaosCrawler.InstanceGroup

     * Return a copy of the instance group removing the randomly generated suffix from
     * its name.
     */
    public InstanceGroup noSuffixInstanceGroup(InstanceGroup group) {
        String newName = group.name().replaceAll("(-)([^-]*$)", "");
        InstanceGroup noSuffixGroup = group.copyAs(newName);
        return noSuffixGroup;
    }
View Full Code Here

Examples of com.netflix.simianarmy.chaos.ChaosCrawler.InstanceGroup

            LOGGER.info(msg);
            throw new FeatureNotEnabledException(msg);
        }
        String prop = NS + "terminateOndemand.enabled";
        if (cfg.getBool(prop)) {
            InstanceGroup group = findInstanceGroup(type, name);
            if (group == null) {
                throw new InstanceGroupNotFoundException(type, name);
            }
            Collection<String> instances = context().chaosInstanceSelector().select(group, 1.0);
            Validate.isTrue(instances.size() <= 1);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.