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();
}
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);
}
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();
}
Aggregations