}
}
public static StrTable getStats()
{
StrTable table = new StrTable("PathFind Buffers Stats");
long inUse, pathFindsTotal = 0, pathFindsPlayable = 0;
double allTimeMillis = 0;
for(BufferInfo buff : all_buffers)
{
pathFindsTotal += buff.totalUses;
pathFindsPlayable += buff.playableUses;
allTimeMillis += buff.useTimeMillis;
inUse = 0;
synchronized(buff)
{
for(PathFindBuffer b : buff.buffers)
{
if(b.inUse)
{
inUse++;
}
}
}
table.set(buff.index, "Size", buff.MapSize);
table.set(buff.index, "Use", inUse);
table.set(buff.index, "Uses", buff.totalUses);
table.set(buff.index, "Alloc", buff.buffers.size() + " of " + buff.buffers.getCapacity());
table.set(buff.index, "unbuf", buff.overBuffers);
if(buff.totalUses > 0)
{
table.set(buff.index, "Avg ms", String.format("%1.3f", buff.useTimeMillis / buff.totalUses));
}
}
table.addTitle("Total / Playable : " + pathFindsTotal + " / " + pathFindsPlayable);
table.addTitle("Total(s) / Avg(ms): " + String.format("%1.2f", allTimeMillis / 1000) + " / " + String.format("%1.3f", allTimeMillis / pathFindsTotal));
return table;
}