Skip to content

Commit

Permalink
Move PageCounterValues to a separate file
Browse files Browse the repository at this point in the history
  • Loading branch information
thobe committed Apr 4, 2017
1 parent dd46b4b commit ca0490b
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 13 deletions.
Expand Up @@ -153,7 +153,7 @@ public QuerySnapshot snapshot()
// just needs to be captured at some point... // just needs to be captured at some point...
long activeLockCount = this.activeLockCount.getAsLong(); long activeLockCount = this.activeLockCount.getAsLong();
long heapAllocatedBytes = heapAllocation.allocatedBytes( threadExecutingTheQuery ); long heapAllocatedBytes = heapAllocation.allocatedBytes( threadExecutingTheQuery );
QuerySnapshot.PageCounterValues pageCounters = new QuerySnapshot.PageCounterValues( pageCursorCounters ); PageCounterValues pageCounters = new PageCounterValues( pageCursorCounters );


// - at this point we are done capturing the "live" state, and can start computing the snapshot - // - at this point we are done capturing the "live" state, and can start computing the snapshot -
long planningTimeNanos = (status.isPlanning() ? currentTimeNanos : planningDoneNanos) - startTimeNanos; long planningTimeNanos = (status.isPlanning() ? currentTimeNanos : planningDoneNanos) - startTimeNanos;
Expand Down
@@ -0,0 +1,33 @@
/*
* 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 <http://www.gnu.org/licenses/>.
*/
package org.neo4j.kernel.api.query;

import org.neo4j.io.pagecache.tracing.cursor.PageCursorCounters;

class PageCounterValues
{
final long hits, faults;

PageCounterValues( PageCursorCounters page )
{
this.hits = page.hits();
this.faults = page.faults();
}
}
Expand Up @@ -24,7 +24,6 @@
import java.util.Map; import java.util.Map;
import java.util.stream.Collectors; import java.util.stream.Collectors;


import org.neo4j.io.pagecache.tracing.cursor.PageCursorCounters;
import org.neo4j.kernel.impl.query.clientconnection.ClientConnectionInfo; import org.neo4j.kernel.impl.query.clientconnection.ClientConnectionInfo;


public class QuerySnapshot public class QuerySnapshot
Expand Down Expand Up @@ -67,17 +66,6 @@ public class QuerySnapshot
this.allocatedBytes = allocatedBytes; this.allocatedBytes = allocatedBytes;
} }


static class PageCounterValues
{
final long hits, faults;

PageCounterValues( PageCursorCounters page )
{
this.hits = page.hits();
this.faults = page.faults();
}
}

public long internalQueryId() public long internalQueryId()
{ {
return query.internalQueryId(); return query.internalQueryId();
Expand Down

0 comments on commit ca0490b

Please sign in to comment.