use of org.neo4j.io.pagecache.tracing.DefaultPageCacheTracer 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.tracing.DefaultPageCacheTracer in project neo4j by neo4j.
the class NeoStoresTest method tracePageCacheAccessOnTransactionCloseCall.
@Test
void tracePageCacheAccessOnTransactionCloseCall() {
StoreFactory factory = getStoreFactory(Config.defaults(), databaseLayout, fs, LOG_PROVIDER);
try (NeoStores neoStore = factory.openAllNeoStores(true)) {
MetaDataStore store = neoStore.getMetaDataStore();
var cacheTracer = new DefaultPageCacheTracer();
var cursorContext = new CursorContext(cacheTracer.createPageCursorTracer("tracePageCacheAccessOnTransactionCloseCall"));
store.transactionClosed(store.nextCommittingTransactionId(), 6666, 15, cursorContext);
PageCursorTracer cursorTracer = cursorContext.getCursorTracer();
assertEquals(1, cursorTracer.pins());
assertEquals(1, cursorTracer.hits());
assertEquals(1, cursorTracer.unpins());
}
}
use of org.neo4j.io.pagecache.tracing.DefaultPageCacheTracer in project neo4j by neo4j.
the class NeoStoresIT method tracePageCacheAccessOnUpdateRecord.
@Test
void tracePageCacheAccessOnUpdateRecord() {
var storageEngine = db.getDependencyResolver().resolveDependency(RecordStorageEngine.class);
var neoStores = storageEngine.testAccessNeoStores();
var nodeStore = neoStores.getNodeStore();
long nodeId;
try (Transaction transaction = db.beginTx()) {
var node = transaction.createNode();
node.setProperty("a", "b");
nodeId = node.getId();
transaction.commit();
}
var cursorContext = new CursorContext(new DefaultPageCacheTracer().createPageCursorTracer("tracePageCacheAccessOnUpdateRecord"));
nodeStore.updateRecord(new NodeRecord(nodeId), cursorContext);
PageCursorTracer cursorTracer = cursorContext.getCursorTracer();
assertEquals(5, cursorTracer.hits());
assertEquals(6, cursorTracer.pins());
assertEquals(6, cursorTracer.unpins());
}
use of org.neo4j.io.pagecache.tracing.DefaultPageCacheTracer in project neo4j by neo4j.
the class NeoStoresIT method tracePageCacheAccessOnHighIdScan.
@Test
void tracePageCacheAccessOnHighIdScan() {
var storageEngine = db.getDependencyResolver().resolveDependency(RecordStorageEngine.class);
var neoStores = storageEngine.testAccessNeoStores();
var propertyStore = neoStores.getPropertyStore();
for (int i = 0; i < 1000; i++) {
try (Transaction transaction = db.beginTx()) {
var node = transaction.createNode();
node.setProperty("a", randomAscii(1024));
transaction.commit();
}
}
var cursorContext = new CursorContext(new DefaultPageCacheTracer().createPageCursorTracer("tracePageCacheAccessOnHighIdScan"));
propertyStore.scanForHighId(cursorContext);
PageCursorTracer cursorTracer = cursorContext.getCursorTracer();
assertEquals(1, cursorTracer.hits());
assertEquals(1, cursorTracer.pins());
assertEquals(1, cursorTracer.unpins());
}
use of org.neo4j.io.pagecache.tracing.DefaultPageCacheTracer in project neo4j by neo4j.
the class NeoStoresIT method tracePageCacheAccessOnGetRawRecordData.
@Test
void tracePageCacheAccessOnGetRawRecordData() throws IOException {
var storageEngine = db.getDependencyResolver().resolveDependency(RecordStorageEngine.class);
var neoStores = storageEngine.testAccessNeoStores();
var propertyStore = neoStores.getPropertyStore();
try (Transaction transaction = db.beginTx()) {
var node = transaction.createNode();
node.setProperty("a", "b");
transaction.commit();
}
var cursorContext = new CursorContext(new DefaultPageCacheTracer().createPageCursorTracer("tracePageCacheAccessOnGetRawRecordData"));
propertyStore.getRawRecordData(1L, cursorContext);
PageCursorTracer cursorTracer = cursorContext.getCursorTracer();
assertEquals(1, cursorTracer.hits());
assertEquals(1, cursorTracer.pins());
assertEquals(1, cursorTracer.unpins());
}
Aggregations