diff --git a/community/io/src/main/java/org/neo4j/io/pagecache/tracing/cursor/PageCursorCounters.java b/community/io/src/main/java/org/neo4j/io/pagecache/tracing/cursor/PageCursorCounters.java
new file mode 100644
index 000000000000..a1828bdb72f9
--- /dev/null
+++ b/community/io/src/main/java/org/neo4j/io/pagecache/tracing/cursor/PageCursorCounters.java
@@ -0,0 +1,52 @@
+/*
+ * Copyright (c) 2002-2017 "Neo Technology,"
+ * Network Engine for Objects in Lund AB [http://neotechnology.com]
+ *
+ * This file is part of Neo4j.
+ *
+ * Neo4j is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+package org.neo4j.io.pagecache.tracing.cursor;
+
+/**
+ * Expose information from page cache about particular page cursor events.
+ *
+ * Exposed counters are relevant only for particular cursor and do not represent global page cache wide picture.
+ *
+ * @see PageCursorCounters
+ * @see PageCursorTracer
+ */
+public interface PageCursorCounters
+{
+ /**
+ * @return The number of page faults observed thus far.
+ */
+ long faults();
+
+ /**
+ * @return The number of page pins observed thus far.
+ */
+ long pins();
+
+ /**
+ * @return The number of page unpins observed thus far.
+ */
+ long unpins();
+
+ /**
+ * @return The sum total of bytes read in through page faults thus far.
+ */
+ long bytesRead();
+
+}
diff --git a/community/io/src/main/java/org/neo4j/io/pagecache/tracing/cursor/PageCursorTracer.java b/community/io/src/main/java/org/neo4j/io/pagecache/tracing/cursor/PageCursorTracer.java
index 42ca2f8871f1..caf17a7a4aed 100644
--- a/community/io/src/main/java/org/neo4j/io/pagecache/tracing/cursor/PageCursorTracer.java
+++ b/community/io/src/main/java/org/neo4j/io/pagecache/tracing/cursor/PageCursorTracer.java
@@ -23,8 +23,16 @@
import org.neo4j.io.pagecache.tracing.PageCacheTracer;
import org.neo4j.io.pagecache.tracing.PinEvent;
-//:TODO javadoc
-public interface PageCursorTracer
+/**
+ * Event tracer for page cursors.
+ *
+ * Performs event tracing related to particular page cursors and expose simple counters around them.
+ * Since events of each particular page cursor are part of whole page cache events, each particular page cursor
+ * tracer will eventually report them to global page cache counters/tracers.
+ *
+ * @see PageCursorTracer
+ */
+public interface PageCursorTracer extends PageCursorCounters
{
PageCursorTracer NULL = new PageCursorTracer()
@@ -72,29 +80,8 @@ public void reportEvents()
}
};
- /**
- * @return The number of page faults observed thus far.
- */
- long faults();
-
- /**
- * @return The number of page pins observed thus far.
- */
- long pins();
-
- /**
- * @return The number of page unpins observed thus far.
- */
- long unpins();
-
- /**
- * @return The sum total of bytes read in through page faults thus far.
- */
- long bytesRead();
-
PinEvent beginPin( boolean writeLock, long filePageId, PageSwapper swapper );
- // TODO:: methods that glue current tracer to page cache tracer can be avoided?
void init( PageCacheTracer tracer );
void reportEvents();
diff --git a/community/kernel/src/main/java/org/neo4j/kernel/impl/api/KernelStatement.java b/community/kernel/src/main/java/org/neo4j/kernel/impl/api/KernelStatement.java
index 1d8392ec1e3e..8a00f5e13054 100644
--- a/community/kernel/src/main/java/org/neo4j/kernel/impl/api/KernelStatement.java
+++ b/community/kernel/src/main/java/org/neo4j/kernel/impl/api/KernelStatement.java
@@ -24,7 +24,7 @@
import org.neo4j.graphdb.NotInTransactionException;
import org.neo4j.graphdb.TransactionTerminatedException;
-import org.neo4j.io.pagecache.tracing.cursor.PageCursorTracer;
+import org.neo4j.io.pagecache.tracing.cursor.PageCursorCounters;
import org.neo4j.kernel.api.DataWriteOperations;
import org.neo4j.kernel.api.query.ExecutingQuery;
import org.neo4j.kernel.api.ProcedureCallOperations;
@@ -53,14 +53,14 @@
*
* - Construct {@link KernelStatement} when {@link KernelTransactionImplementation} is constructed
* - For every transaction...
- * - Call {@link #initialize(StatementLocks, StatementOperationParts, PageCursorTracer)} which makes this instance
+ *
- Call {@link #initialize(StatementLocks, StatementOperationParts, PageCursorCounters)} which makes this instance
* full available and ready to use. Call when the {@link KernelTransactionImplementation} is initialized.
* - Alternate {@link #acquire()} / {@link #close()} when acquiring / closing a statement for the transaction...
* Temporarily asymmetric number of calls to {@link #acquire()} / {@link #close()} is supported, although in
* the end an equal number of calls must have been issued.
* - To be safe call {@link #forceClose()} at the end of a transaction to force a close of the statement,
* even if there are more than one current call to {@link #acquire()}. This instance is now again ready
- * to be {@link #initialize(StatementLocks, StatementOperationParts, PageCursorTracer) initialized} and used for the transaction
+ * to be {@link #initialize(StatementLocks, StatementOperationParts, PageCursorCounters)} initialized} and used for the transaction
* instance again, when it's initialized.
*
*/
@@ -72,7 +72,7 @@ public class KernelStatement implements TxStateHolder, Statement
private final KernelTransactionImplementation transaction;
private final OperationsFacade facade;
private StatementLocks statementLocks;
- private PageCursorTracer pageCursorTracer;
+ private PageCursorCounters pageCursorCounters;
private int referenceCount;
private volatile ExecutingQueryList executingQueryList;
private final LockTracer systemLockTracer;
@@ -186,10 +186,10 @@ void assertOpen()
}
public void initialize( StatementLocks statementLocks, StatementOperationParts operationParts,
- PageCursorTracer pageCursorTracer )
+ PageCursorCounters pageCursorCounters )
{
this.statementLocks = statementLocks;
- this.pageCursorTracer = pageCursorTracer;
+ this.pageCursorCounters = pageCursorCounters;
facade.initialize( operationParts );
}
@@ -204,9 +204,9 @@ public LockTracer lockTracer()
return tracer == null ? systemLockTracer : systemLockTracer.combine( tracer );
}
- public PageCursorTracer getPageCursorTracer()
+ public PageCursorCounters getPageCursorCounters()
{
- return pageCursorTracer;
+ return pageCursorCounters;
}
public final void acquire()