All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.arquillian.cube.q.simianarmy.client.BurnCpuSimianArmyChaosScript Maven / Gradle / Ivy

The newest version!
package org.arquillian.cube.q.simianarmy.client;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

public class BurnCpuSimianArmyChaosScript extends SimianArmyScriptChaos {

    private int numberCpu;

    public BurnCpuSimianArmyChaosScript(int numberCpu) {
        super("burncpu");
        this.numberCpu = numberCpu;
    }


    @Override
    public String[] postProcessScript(String[] chaosScriptsContent) {
        List commands = new ArrayList<>();

        for (int i = 0; i < numberCpu; i++) {
           Collections.addAll(commands, chaosScriptsContent);
        }

        return commands.toArray(new String[commands.size()]);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy