use of org.neo4j.io.pagecache.tracing.cursor.PageCursorTracer in project neo4j by neo4j.
the class RecordStoreVersionCheckTest method tracePageCacheAccessOnCheckUpgradable.
@Test
void tracePageCacheAccessOnCheckUpgradable() throws IOException {
Path neoStore = emptyFile(fileSystem);
String storeVersion = "V1";
long v1 = MetaDataStore.versionStringToLong(storeVersion);
MetaDataStore.setRecord(pageCache, neoStore, MetaDataStore.Position.STORE_VERSION, v1, databaseLayout.getDatabaseName(), NULL);
RecordStoreVersionCheck storeVersionCheck = newStoreVersionCheck();
var pageCacheTracer = new DefaultPageCacheTracer();
var cursorContext = new CursorContext(pageCacheTracer.createPageCursorTracer("tracePageCacheAccessOnCheckUpgradable"));
StoreVersionCheck.Result result = storeVersionCheck.checkUpgrade(storeVersion, cursorContext);
assertTrue(result.outcome.isSuccessful());
PageCursorTracer cursorTracer = cursorContext.getCursorTracer();
assertThat(cursorTracer.pins()).isOne();
assertThat(cursorTracer.unpins()).isOne();
assertThat(cursorTracer.faults()).isOne();
}
use of org.neo4j.io.pagecache.tracing.cursor.PageCursorTracer in project neo4j by neo4j.
the class LuceneFulltextIndexTest method assertZeroTracer.
private void assertZeroTracer(CursorContext cursorContext) {
PageCursorTracer cursorTracer = cursorContext.getCursorTracer();
assertThat(cursorTracer.pins()).isZero();
assertThat(cursorTracer.unpins()).isZero();
assertThat(cursorTracer.hits()).isZero();
assertThat(cursorTracer.faults()).isZero();
}
use of org.neo4j.io.pagecache.tracing.cursor.PageCursorTracer in project neo4j by neo4j.
the class NeoStoresTest method tracePageCacheAccessOnTransactionCommittedCall.
@Test
void tracePageCacheAccessOnTransactionCommittedCall() {
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("tracePageCacheAccessOnTransactionCommittedCall"));
store.transactionCommitted(42, 6666, BASE_TX_COMMIT_TIMESTAMP, cursorContext);
PageCursorTracer cursorTracer = cursorContext.getCursorTracer();
assertEquals(1, cursorTracer.pins());
assertEquals(1, cursorTracer.hits());
assertEquals(1, cursorTracer.unpins());
}
}
use of org.neo4j.io.pagecache.tracing.cursor.PageCursorTracer in project neo4j by neo4j.
the class NeoStoresIT method tracePageCacheAccessOnTokenReads.
@Test
void tracePageCacheAccessOnTokenReads() {
var storageEngine = db.getDependencyResolver().resolveDependency(RecordStorageEngine.class);
var neoStores = storageEngine.testAccessNeoStores();
var propertyKeys = neoStores.getPropertyKeyTokenStore();
try (Transaction transaction = db.beginTx()) {
var node = transaction.createNode();
node.setProperty("a", "b");
transaction.commit();
}
var cursorContext = new CursorContext(new DefaultPageCacheTracer().createPageCursorTracer("tracePageCacheAccessOnTokenReads"));
propertyKeys.getAllReadableTokens(cursorContext);
PageCursorTracer cursorTracer = cursorContext.getCursorTracer();
assertEquals(22, cursorTracer.hits());
assertEquals(22, cursorTracer.pins());
assertEquals(22, cursorTracer.unpins());
}
use of org.neo4j.io.pagecache.tracing.cursor.PageCursorTracer in project neo4j by neo4j.
the class NeoStoresIT method tracePageCacheAccessOnInUseCheck.
@Test
void tracePageCacheAccessOnInUseCheck() {
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("tracePageCacheAccessOnInUseCheck"));
propertyStore.isInUse(1L, cursorContext);
PageCursorTracer cursorTracer = cursorContext.getCursorTracer();
assertEquals(1, cursorTracer.hits());
assertEquals(1, cursorTracer.pins());
assertEquals(1, cursorTracer.unpins());
}
Aggregations