Search in sources :

Example 1 with CSVReport

use of org.btrplace.safeplace.testing.reporting.CSVReport in project scheduler by btrplace.

the class DSN method discreteVsContinuous.

// @Test
public void discreteVsContinuous() throws Exception {
    TestScanner sc = newScanner();
    Bench.population = 500;
    Bench.scale = 10;
    Path path = Paths.get(root, "restriction_stable.csv");
    Files.deleteIfExists(path);
    boolean first = true;
    for (Restriction r : EnumSet.allOf(Restriction.class)) {
        if (first) {
            Bench.mode = Bench.Mode.SAVE;
            first = !first;
        } else {
            Bench.mode = Bench.Mode.REPLAY;
        }
        System.out.println("--- Restriction: " + r + "; replay= " + first + " ---");
        Bench.report = new CSVReport(path, r.toString());
        sc.testGroups("bi").forEach(x -> {
            Bench.restrictions = EnumSet.of(r);
            System.out.println(x.go());
        });
    }
    // restore
    Bench.restrictions = EnumSet.allOf(Restriction.class);
}
Also used : Path(java.nio.file.Path) Restriction(org.btrplace.safeplace.testing.fuzzer.Restriction) TestScanner(org.btrplace.safeplace.testing.TestScanner) CSVReport(org.btrplace.safeplace.testing.reporting.CSVReport)

Example 2 with CSVReport

use of org.btrplace.safeplace.testing.reporting.CSVReport in project scheduler by btrplace.

the class DSN method errors.

// @Test
public void errors() throws Exception {
    TestScanner sc = newScanner();
    Bench.source = "xp-dsn";
    Bench.mode = Bench.Mode.REPLAY;
    Bench.population = 1000;
    Bench.scale = 5;
    Path p = Paths.get(root, "errors.csv");
    Files.deleteIfExists(p);
    Bench.report = new CSVReport(p, "");
    sc.test(Bench.class).stream().forEach(x -> System.out.println(x.go()));
}
Also used : Path(java.nio.file.Path) TestScanner(org.btrplace.safeplace.testing.TestScanner) CSVReport(org.btrplace.safeplace.testing.reporting.CSVReport)

Example 3 with CSVReport

use of org.btrplace.safeplace.testing.reporting.CSVReport in project scheduler by btrplace.

the class DSN method specVsCheckers.

// @Test
public void specVsCheckers() throws Exception {
    TestScanner sc = newScanner();
    Bench.population = 500;
    Bench.scale = 10;
    Path p = Paths.get(root, "verifier_stable.csv");
    Files.deleteIfExists(p);
    boolean first = true;
    for (Verifier v : new Verifier[] { new SpecVerifier(), new CheckerVerifier() }) {
        if (first) {
            Bench.mode = Bench.Mode.SAVE;
            first = !first;
        } else {
            Bench.mode = Bench.Mode.REPLAY;
        }
        System.out.println("--- Verifier: " + v.getClass() + " ---");
        Bench.report = new CSVReport(p, v.id());
        sc.test(Bench.class).forEach(c -> {
            c.verifyWith(v);
            System.out.println(c.go().toString());
        });
    }
}
Also used : Path(java.nio.file.Path) SpecVerifier(org.btrplace.safeplace.testing.verification.spec.SpecVerifier) Bench(org.btrplace.safeplace.testing.Bench) CheckerVerifier(org.btrplace.safeplace.testing.verification.btrplace.CheckerVerifier) TestScanner(org.btrplace.safeplace.testing.TestScanner) CSVReport(org.btrplace.safeplace.testing.reporting.CSVReport) SpecVerifier(org.btrplace.safeplace.testing.verification.spec.SpecVerifier) Verifier(org.btrplace.safeplace.testing.verification.Verifier) CheckerVerifier(org.btrplace.safeplace.testing.verification.btrplace.CheckerVerifier)

Example 4 with CSVReport

use of org.btrplace.safeplace.testing.reporting.CSVReport 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());
        });
    }
}
Also used : Path(java.nio.file.Path) Bench(org.btrplace.safeplace.testing.Bench) TestScanner(org.btrplace.safeplace.testing.TestScanner) CSVReport(org.btrplace.safeplace.testing.reporting.CSVReport)

Example 5 with CSVReport

use of org.btrplace.safeplace.testing.reporting.CSVReport 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()));
    }
}
Also used : Path(java.nio.file.Path) Bench(org.btrplace.safeplace.testing.Bench) TestScanner(org.btrplace.safeplace.testing.TestScanner) CSVReport(org.btrplace.safeplace.testing.reporting.CSVReport) Constraint(org.btrplace.safeplace.spec.Constraint)

Aggregations

Path (java.nio.file.Path)6 TestScanner (org.btrplace.safeplace.testing.TestScanner)6 CSVReport (org.btrplace.safeplace.testing.reporting.CSVReport)6 Bench (org.btrplace.safeplace.testing.Bench)3 Constraint (org.btrplace.safeplace.spec.Constraint)2 TestCampaign (org.btrplace.safeplace.testing.TestCampaign)1 Restriction (org.btrplace.safeplace.testing.fuzzer.Restriction)1 Verifier (org.btrplace.safeplace.testing.verification.Verifier)1 CheckerVerifier (org.btrplace.safeplace.testing.verification.btrplace.CheckerVerifier)1 SpecVerifier (org.btrplace.safeplace.testing.verification.spec.SpecVerifier)1