Search in sources :

Example 21 with PageCursorTracer

use of org.neo4j.io.pagecache.tracing.cursor.PageCursorTracer in project neo4j by neo4j.

the class CommitProcessTracingIT method assertZeroCursor.

private void assertZeroCursor(CursorContext cursorContext) {
    PageCursorTracer cursorTracer = cursorContext.getCursorTracer();
    assertThat(cursorTracer.pins()).isZero();
    assertThat(cursorTracer.unpins()).isZero();
    assertThat(cursorTracer.hits()).isZero();
}
Also used : PageCursorTracer(org.neo4j.io.pagecache.tracing.cursor.PageCursorTracer)

Example 22 with PageCursorTracer

use of org.neo4j.io.pagecache.tracing.cursor.PageCursorTracer in project neo4j by neo4j.

the class NodeEntityTest method traceNodePageCacheAccessOnRelationshipTypeAndDegreeCount.

@Test
void traceNodePageCacheAccessOnRelationshipTypeAndDegreeCount() {
    long sourceId;
    var relationshipType = RelationshipType.withName("connection");
    try (Transaction tx = db.beginTx()) {
        var source = tx.createNode();
        createDenseNodeWithShortIncomingChain(tx, source, relationshipType);
        sourceId = source.getId();
        tx.commit();
    }
    try (Transaction tx = db.beginTx()) {
        var cursorContext = ((InternalTransaction) tx).kernelTransaction().cursorContext();
        PageCursorTracer cursorTracer = cursorContext.getCursorTracer();
        var source = tx.getNodeById(sourceId);
        cursorTracer.reportEvents();
        assertZeroTracer(cursorContext);
        source.getDegree(relationshipType, Direction.INCOMING);
        assertThat(cursorTracer.hits()).isEqualTo(3);
        assertThat(cursorTracer.unpins()).isEqualTo(0);
        assertThat(cursorTracer.pins()).isEqualTo(3);
    }
}
Also used : PageCursorTracer(org.neo4j.io.pagecache.tracing.cursor.PageCursorTracer) InternalTransaction(org.neo4j.kernel.impl.coreapi.InternalTransaction) Transaction(org.neo4j.graphdb.Transaction) Test(org.junit.jupiter.api.Test)

Example 23 with PageCursorTracer

use of org.neo4j.io.pagecache.tracing.cursor.PageCursorTracer in project neo4j by neo4j.

the class NodeEntityTest method assertZeroTracer.

private void assertZeroTracer(CursorContext cursorContext) {
    PageCursorTracer cursorTracer = cursorContext.getCursorTracer();
    assertThat(cursorTracer.hits()).isZero();
    assertThat(cursorTracer.unpins()).isZero();
    assertThat(cursorTracer.pins()).isZero();
}
Also used : PageCursorTracer(org.neo4j.io.pagecache.tracing.cursor.PageCursorTracer)

Example 24 with PageCursorTracer

use of org.neo4j.io.pagecache.tracing.cursor.PageCursorTracer in project neo4j by neo4j.

the class ReadTracingIT method assertOneCursor.

private void assertOneCursor(CursorContext cursorContext) {
    PageCursorTracer cursorTracer = cursorContext.getCursorTracer();
    assertThat(cursorTracer.pins()).isOne();
    assertThat(cursorTracer.unpins()).isOne();
    assertThat(cursorTracer.hits()).isOne();
}
Also used : PageCursorTracer(org.neo4j.io.pagecache.tracing.cursor.PageCursorTracer)

Example 25 with PageCursorTracer

use of org.neo4j.io.pagecache.tracing.cursor.PageCursorTracer in project neo4j by neo4j.

the class ReadTracingIT method assertZeroCursor.

private void assertZeroCursor(CursorContext cursorContext) {
    PageCursorTracer cursorTracer = cursorContext.getCursorTracer();
    assertThat(cursorTracer.pins()).isZero();
    assertThat(cursorTracer.unpins()).isZero();
    assertThat(cursorTracer.hits()).isZero();
    assertThat(cursorTracer.faults()).isZero();
}
Also used : PageCursorTracer(org.neo4j.io.pagecache.tracing.cursor.PageCursorTracer)

Aggregations

PageCursorTracer (org.neo4j.io.pagecache.tracing.cursor.PageCursorTracer)47 Test (org.junit.jupiter.api.Test)30 CursorContext (org.neo4j.io.pagecache.context.CursorContext)27 DefaultPageCacheTracer (org.neo4j.io.pagecache.tracing.DefaultPageCacheTracer)26 Transaction (org.neo4j.graphdb.Transaction)11 InternalTransaction (org.neo4j.kernel.impl.coreapi.InternalTransaction)5 Path (java.nio.file.Path)2 MutableLong (org.apache.commons.lang3.mutable.MutableLong)2 IndexSample (org.neo4j.kernel.api.index.IndexSample)2 NodeRecord (org.neo4j.kernel.impl.store.record.NodeRecord)2 GraphDatabaseAPI (org.neo4j.kernel.internal.GraphDatabaseAPI)2 Test (org.junit.Test)1 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)1 MethodSource (org.junit.jupiter.params.provider.MethodSource)1 DatabaseManagementService (org.neo4j.dbms.api.DatabaseManagementService)1 KernelTransaction (org.neo4j.kernel.api.KernelTransaction)1 DynamicRecord (org.neo4j.kernel.impl.store.record.DynamicRecord)1 PropertyBlock (org.neo4j.kernel.impl.store.record.PropertyBlock)1 ExternalStoreId (org.neo4j.storageengine.api.ExternalStoreId)1 IndexEntryUpdate (org.neo4j.storageengine.api.IndexEntryUpdate)1