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