use of org.btrplace.safeplace.testing.TestScanner in project scheduler by btrplace.
the class DSN method repairVsRebuild.
// @Test
public void repairVsRebuild() throws Exception {
TestScanner sc = newScanner();
Bench.population = 500;
Bench.scale = 10;
Path path = Paths.get(root, "mode_stable.csv");
Files.deleteIfExists(path);
boolean first = true;
for (boolean repair : new boolean[] { false, true }) {
if (first) {
Bench.mode = Bench.Mode.SAVE;
first = !first;
} else {
Bench.mode = Bench.Mode.REPLAY;
}
System.out.println("--- Repair: " + repair + "; replay= " + first + " ---");
Bench.report = new CSVReport(path, repair ? "enabled" : "disabled");
sc.test(Bench.class).forEach(x -> {
x.schedulerParams().doRepair(true);
System.out.println(x.go());
});
}
}
use of org.btrplace.safeplace.testing.TestScanner in project scheduler by btrplace.
the class DSN method fuzzingScalability.
// @Test
public void fuzzingScalability() throws Exception {
TestScanner sc = newScanner();
// Warm-up
Bench.transitions = true;
Path p = Paths.get(root, "testing-speed-notrans.csv");
Files.deleteIfExists(p);
/* for (int i = 10; i <= 30; i+=2) {
Bench.transitions = false;
Bench.population = 100;
Bench.scale = i;
System.out.println("--- scaling factor " + i + "; transitions= " + Bench.transitions +" ---");
Bench.report = new CSVReport(p,"");
System.out.println(sc.test(Bench.class).stream().mapToInt(TestCampaign::go).sum());
}*/
// GOGO
p = Paths.get(root, "testing-speed-notrans.csv");
Files.deleteIfExists(p);
Bench.mode = Bench.Mode.DEFAULT;
for (int i = 1; i <= 30; i += 2) {
Bench.transitions = false;
Bench.population = 100;
Bench.scale = i;
System.out.println("--- scaling factor " + i + "; transitions= " + Bench.transitions + " ---");
Bench.report = new CSVReport(p, "");
sc.test(Bench.class).forEach(c -> System.out.println(c.go().toString()));
}
p = Paths.get(root, "testing-speed-trans.csv");
Files.deleteIfExists(p);
for (int i = 1; i <= 30; i += 2) {
System.out.println("--- scaling factor " + i + "; transitions= " + Bench.transitions + " ---");
Bench.transitions = true;
Bench.population = 100;
Bench.scale = i;
Bench.report = new CSVReport(p, "");
sc.test(Bench.class).forEach(c -> System.out.println(c.go().toString()));
}
}
use of org.btrplace.safeplace.testing.TestScanner in project scheduler by btrplace.
the class DSN method fuzzingSizing.
// //@Test
public void fuzzingSizing() throws Exception {
TestScanner sc = newScanner();
Path path = Paths.get(root, "fuzz.csv");
Files.deleteIfExists(path);
for (int p = 100; p <= 1000; p += 100) {
for (int s = 2; s <= 20; s += 2) {
System.out.println("--- Population: " + p + " scale: " + s + " ---");
Bench.report = new CSVReport(path, Integer.toString(p));
Bench.population = p;
Bench.scale = s;
List<TestCampaign> campaigns = sc.testGroups("sides");
if (campaigns.isEmpty()) {
Assert.fail("Nothing to test");
}
campaigns.stream().forEach(c -> System.out.println(c.go().toString()));
}
}
}
Aggregations