public BenchmarkStats variantBenchmark() throws ClassNotFoundException, StorageEngineException, InstantiationException, IllegalAccessException, ExecutionException, InterruptedException { BenchmarkRunner benchmarkRunner = new VariantBenchmarkRunner(storageConfiguration); BenchmarkStats benchmarkStats = benchmarkRunner.query(storageConfiguration.getBenchmark().getNumRepetitions(), new HashSet<>(storageConfiguration.getBenchmark().getQueries())); return benchmarkStats; }
public void addThreadGroup(List<? extends Sampler> samplers) { // Loop Controller LoopController loopController = new LoopController(); loopController.setLoops(storageConfiguration.getBenchmark().getNumRepetitions()); loopController.setFirst(true); loopController.setProperty(TestElement.TEST_CLASS, LoopController.class.getName()); loopController.setProperty(TestElement.GUI_CLASS, LoopControlPanel.class.getName()); loopController.initialize(); // Thread Group ThreadGroup threadGroup = new ThreadGroup(); threadGroup.setName("Thread-Group"); threadGroup.setNumThreads(storageConfiguration.getBenchmark().getConcurrency()); threadGroup.setRampUp(1); threadGroup.setSamplerController(loopController); threadGroup.setProperty(TestElement.TEST_CLASS, ThreadGroup.class.getName()); threadGroup.setProperty(TestElement.GUI_CLASS, ThreadGroupGui.class.getName()); // Construct Test Plan from previously initialized elements HashTree threadGroupHashTree = testPlanTree.add(testPlan, threadGroup); ConstantTimer timer = new ConstantTimer(); timer.setDelay(String.valueOf(storageConfiguration.getBenchmark().getDelay())); timer.setName("timer"); // Add samplers to the ThreadGroup threadGroupHashTree.add(samplers); // Add timer to the ThreadGroup threadGroupHashTree.add(timer); }
storageConfiguration.getBenchmark().getTable(), storageConfiguration.getBenchmark().getNumRepetitions(), storageConfiguration.getBenchmark().getConcurrency()); return benchmarkStats;