Search in sources :

Example 1 with PageCacheStressTest

use of org.neo4j.io.pagecache.stress.PageCacheStressTest in project neo4j by neo4j.

the class MuninnPageCacheStressIT method shouldHandleTheStressOfOneMillionEvictions.

@Test
public void shouldHandleTheStressOfOneMillionEvictions() throws Exception {
    DefaultPageCacheTracer monitor = new DefaultPageCacheTracer();
    Condition condition = numberOfEvictions(monitor, 1_000_000);
    PageCacheStressTest runner = new PageCacheStressTest.Builder().withWorkingDirectory(testDirectory.directory()).with(monitor).with(condition).build();
    runner.run();
}
Also used : Condition(org.neo4j.io.pagecache.stress.Condition) PageCacheStressTest(org.neo4j.io.pagecache.stress.PageCacheStressTest) DefaultPageCacheTracer(org.neo4j.io.pagecache.tracing.DefaultPageCacheTracer) PageCacheStressTest(org.neo4j.io.pagecache.stress.PageCacheStressTest) Test(org.junit.Test)

Example 2 with PageCacheStressTest

use of org.neo4j.io.pagecache.stress.PageCacheStressTest in project neo4j by neo4j.

the class PageCacheStressTesting method shouldBehaveCorrectlyUnderStress.

@Test
public void shouldBehaveCorrectlyUnderStress() throws Exception {
    int durationInMinutes = parseInt(fromEnv("PAGE_CACHE_STRESS_DURATION", "1"));
    int numberOfPages = parseInt(fromEnv("PAGE_CACHE_STRESS_NUMBER_OF_PAGES", "10000"));
    int numberOfThreads = parseInt(fromEnv("PAGE_CACHE_STRESS_NUMBER_OF_THREADS", "8"));
    int numberOfCachePages = parseInt(fromEnv("PAGE_CACHE_STRESS_NUMBER_OF_CACHE_PAGES", "1000"));
    File baseDir = new File(fromEnv("PAGE_CACHE_STRESS_WORKING_DIRECTORY", getProperty("java.io.tmpdir")));
    File workingDirectory = new File(baseDir, "working");
    DefaultPageCacheTracer monitor = new DefaultPageCacheTracer();
    PageCacheStressTest runner = new PageCacheStressTest.Builder().with(timePeriod(durationInMinutes, MINUTES)).withNumberOfPages(numberOfPages).withNumberOfThreads(numberOfThreads).withNumberOfCachePages(numberOfCachePages).withWorkingDirectory(ensureExistsAndEmpty(workingDirectory)).with(monitor).build();
    runner.run();
    long faults = monitor.faults();
    long evictions = monitor.evictions();
    long pins = monitor.pins();
    long unpins = monitor.unpins();
    long flushes = monitor.flushes();
    System.out.printf(" - page faults: %d%n - evictions: %d%n - pins: %d%n - unpins: %d%n - flushes: %d%n", faults, evictions, pins, unpins, flushes);
    // let's cleanup disk space when everything went well
    FileUtils.deleteRecursively(workingDirectory);
}
Also used : PageCacheStressTest(org.neo4j.io.pagecache.stress.PageCacheStressTest) File(java.io.File) DefaultPageCacheTracer(org.neo4j.io.pagecache.tracing.DefaultPageCacheTracer) PageCacheStressTest(org.neo4j.io.pagecache.stress.PageCacheStressTest) Test(org.junit.Test)

Example 3 with PageCacheStressTest

use of org.neo4j.io.pagecache.stress.PageCacheStressTest in project neo4j by neo4j.

the class MuninnPageCacheStressIT method shouldHandleTheStressOfManyManyEvictions.

@Test
void shouldHandleTheStressOfManyManyEvictions() throws Exception {
    DefaultPageCacheTracer monitor = new DefaultPageCacheTracer();
    Condition condition = numberOfEvictions(monitor, 100_000);
    PageCacheStressTest runner = new PageCacheStressTest.Builder().withWorkingDirectory(testDirectory.homePath()).with(monitor).with(condition).build();
    runner.run();
}
Also used : Condition(org.neo4j.io.pagecache.stress.Condition) PageCacheStressTest(org.neo4j.io.pagecache.stress.PageCacheStressTest) DefaultPageCacheTracer(org.neo4j.io.pagecache.tracing.DefaultPageCacheTracer) Test(org.junit.jupiter.api.Test) PageCacheStressTest(org.neo4j.io.pagecache.stress.PageCacheStressTest)

Aggregations

PageCacheStressTest (org.neo4j.io.pagecache.stress.PageCacheStressTest)3 DefaultPageCacheTracer (org.neo4j.io.pagecache.tracing.DefaultPageCacheTracer)3 Test (org.junit.Test)2 Condition (org.neo4j.io.pagecache.stress.Condition)2 File (java.io.File)1 Test (org.junit.jupiter.api.Test)1