Permalink
Browse files

More detailed output from WindowPoolStats.

  • Loading branch information...
1 parent 16546fe commit d1075b0d4baba6d5b5a96d17e3c3ed92870a4e8c @tinwelint tinwelint committed with apcj Aug 20, 2012
@@ -105,6 +105,7 @@ public PersistenceWindowPool( String storeName, int blockSize,
this.mapMode = readOnly ? MapMode.READ_ONLY : MapMode.READ_WRITE;
setupBricks();
dumpStatus();
+ System.out.println( getStats().toString() );
}
/**
@@ -19,6 +19,8 @@
*/
package org.neo4j.kernel.impl.nioneo.store;
+import java.io.File;
+
public class WindowPoolStats
{
private final String name;
@@ -33,32 +35,34 @@
private final int missCount;
private final int oomCount;
- private int switches;
-
- private int avgRefreshTime;
-
- private int numRefreshes;
-
- private int avertedRefreshes;
+ private final int switchCount;
+ private final int avgRefreshTime;
+ private final int refreshCount;
+ private final int avertedRefreshCount;
public WindowPoolStats( String name, long memAvail, long memUsed, int windowCount,
- int windowSize, int hitCount, int missCount, int oomCount, int switches, int avgRefreshTime,
- int numRefreshes, int avertedRefreshes )
+ int windowSize, int hitCount, int missCount, int oomCount, int switchCount, int avgRefreshTime,
+ int refreshCount, int avertedRefreshCount )
{
- this.name = name;
+ this.name = extractName( name );
this.memAvail = memAvail;
this.memUsed = memUsed;
this.windowCount = windowCount;
this.windowSize = windowSize;
this.hitCount = hitCount;
this.missCount = missCount;
this.oomCount = oomCount;
- this.switches = switches;
+ this.switchCount = switchCount;
this.avgRefreshTime = avgRefreshTime;
- this.numRefreshes = numRefreshes;
- this.avertedRefreshes = avertedRefreshes;
+ this.refreshCount = refreshCount;
+ this.avertedRefreshCount = avertedRefreshCount;
}
+ private String extractName( String name )
+ {
+ return new File( name ).getName();
+ }
+
public String getName()
{
return name;
@@ -99,41 +103,41 @@ public int getOomCount()
return oomCount;
}
- public int getSwitches()
+ public int getSwitchCount()
{
- return switches;
+ return switchCount;
}
public int getAvgRefreshTime()
{
return avgRefreshTime;
}
- public int getNumRefreshes()
+ public int getRefreshCount()
{
- return numRefreshes;
+ return refreshCount;
}
- public int getAvertedRefreshes()
+ public int getAvertedRefreshCount()
{
- return avertedRefreshes;
+ return avertedRefreshCount;
}
@Override
public String toString()
{
- return "WindowPoolStats[" +
- "mem available:" + memAvail + " " +
- "mem used:" + memUsed + " " +
- "windows:" + windowCount + " " +
- "win size:" + windowSize + " " +
- "hits:" + hitCount + " " +
- "misses:" + missCount + " " +
- "ooms:" + oomCount + " " +
- "switches:" + switches + " " +
- "avg refr time:" + avgRefreshTime + " " +
- "refreshes:" + numRefreshes + " " +
- "averted refreshes:" + avertedRefreshes +
+ return "WindowPoolStats['" + name + "', " +
+ "memAvail:" + memAvail + ", " +
+ "memUsed:" + memUsed + ", " +
+ "windowCount:" + windowCount + ", " +
+ "windowSize:" + windowSize + ", " +
+ "hitCount:" + hitCount + ", " +
+ "missCount:" + missCount + ", " +
+ "oomCount:" + oomCount + ", " +
+ "switchCount:" + switchCount + ", " +
+ "avgRefreshTime:" + avgRefreshTime + ", " +
+ "refreshCount:" + refreshCount + ", " +
+ "avertedRefreshCount:" + avertedRefreshCount +
"]";
}
}

0 comments on commit d1075b0

Please sign in to comment.