Search in sources :

Example 1 with DeployFileTask

use of org.camunda.bpm.qa.performance.engine.loadgenerator.tasks.DeployFileTask in project camunda-bpm-platform by camunda.

the class StartProcessInstancesInDirectory method main.

public static void main(String[] args) throws InterruptedException {
    ProcessEngine processEngine = PerfTestProcessEngine.getInstance();
    final LoadGeneratorConfiguration config = new LoadGeneratorConfiguration();
    final List<String> deployableFiles = findDeployableFiles(new File("."));
    final Runnable[] setupTasks = new Runnable[deployableFiles.size()];
    for (int i = 0; i < deployableFiles.size(); i++) {
        setupTasks[i] = new DeployFileTask(processEngine, deployableFiles.get(i));
    }
    config.setSetupTasks(setupTasks);
    final List<String> processKeys = extractProcessDefinitionKeys(deployableFiles);
    final Runnable[] workerRunnables = new Runnable[processKeys.size()];
    for (int i = 0; i < processKeys.size(); i++) {
        workerRunnables[i] = new StartProcessInstanceTask(processEngine, processKeys.get(i));
    }
    config.setWorkerTasks(workerRunnables);
    final LoadGenerator loadGenerator = new LoadGenerator(config);
    loadGenerator.execute();
}
Also used : StartProcessInstanceTask(org.camunda.bpm.qa.performance.engine.loadgenerator.tasks.StartProcessInstanceTask) DeployFileTask(org.camunda.bpm.qa.performance.engine.loadgenerator.tasks.DeployFileTask) File(java.io.File) ProcessEngine(org.camunda.bpm.engine.ProcessEngine) PerfTestProcessEngine(org.camunda.bpm.qa.performance.engine.junit.PerfTestProcessEngine)

Aggregations

File (java.io.File)1 ProcessEngine (org.camunda.bpm.engine.ProcessEngine)1 PerfTestProcessEngine (org.camunda.bpm.qa.performance.engine.junit.PerfTestProcessEngine)1 DeployFileTask (org.camunda.bpm.qa.performance.engine.loadgenerator.tasks.DeployFileTask)1 StartProcessInstanceTask (org.camunda.bpm.qa.performance.engine.loadgenerator.tasks.StartProcessInstanceTask)1