diff --git a/mcp/mobius/opis/data/managers/GlobalTimingManager.java b/mcp/mobius/opis/data/managers/GlobalTimingManager.java index e657529..15ed43d 100644 --- a/mcp/mobius/opis/data/managers/GlobalTimingManager.java +++ b/mcp/mobius/opis/data/managers/GlobalTimingManager.java @@ -20,19 +20,6 @@ public enum GlobalTimingManager { public HashMap worldTickStats = new HashMap(); public HashMap entUpdateStats = new HashMap(); - HashBasedTable statsDim = HashBasedTable.create(); - HashBasedTable statsChunk = HashBasedTable.create(); - - - /* - public static HashMap worldUpdatesStats = new HashMap(); - public static HashMap worldBlocksAndAmbianceStats = new HashMap(); - public static HashMap worldPlayerInstancesStats = new HashMap(); - public static HashMap worldVillageCollectionStats = new HashMap(); - public static HashMap worldVillageSiegeStats = new HashMap(); - public static HashMap worldApplyBlockEventsStats = new HashMap(); - */ - /* Add an entity to the stat array, with timing data */ public void addStat(int id, long timing, HashMap target){ if (!(target.containsKey(id))) @@ -46,52 +33,4 @@ public enum GlobalTimingManager { total += target.get(dim).getGeometricMean(); return total; } - - public void addStat(int id, String subsection, long timing){ - if (!statsDim.contains(id, subsection)){ - statsDim.put(id, subsection, new StatsWorld(id)); - } - statsDim.get(id, subsection).addMeasure(timing); - } - - public void addStat(CoordinatesChunk coord, String subsection, long timing){ - - if (!statsChunk.contains(coord, subsection)){ - statsChunk.put(coord, subsection, new StatsChunkMedian(coord)); - } - statsChunk.get(coord, subsection).addMeasure(timing); - } - - public HashBasedTable getStatsChunk(){ - HashBasedTable timings = HashBasedTable.create(); - - for(Table.Cell cell : this.statsChunk.cellSet()){ - timings.put(cell.getRowKey(), cell.getColumnKey(), cell.getValue().getGeometricMean()); - } - - return timings; - } - - public HashBasedTable getStatsDim(){ - HashBasedTable timings = HashBasedTable.create(); - - for(Table.Cell cell : this.statsDim.cellSet()){ - timings.put(cell.getRowKey(), cell.getColumnKey(), cell.getValue().getGeometricMean()); - } - - return timings; - } - - public HashBasedTable getStatsDimPerSection(){ - HashBasedTable timings = HashBasedTable.create(); - - for(Table.Cell cell : this.statsChunk.cellSet()){ - if (!timings.contains(cell.getRowKey().dim, cell.getColumnKey())) - timings.put(cell.getRowKey().dim, cell.getColumnKey(), 0.0); - - timings.put(cell.getRowKey().dim, cell.getColumnKey(), timings.get(cell.getRowKey().dim, cell.getColumnKey()) + cell.getValue().getGeometricMean()); - } - - return timings; - } } diff --git a/mcp/mobius/opis/data/managers/MetaManager.java b/mcp/mobius/opis/data/managers/MetaManager.java index e0faa17..27028df 100644 --- a/mcp/mobius/opis/data/managers/MetaManager.java +++ b/mcp/mobius/opis/data/managers/MetaManager.java @@ -20,7 +20,6 @@ public class MetaManager { TickHandlerManager.endStats.clear(); GlobalTimingManager.INSTANCE.worldTickStats.clear(); GlobalTimingManager.INSTANCE.entUpdateStats.clear(); - GlobalTimingManager.INSTANCE.statsDim.clear(); ProfilerRegistrar.turnOff(); ProfilerSection.desactivateAll(); diff --git a/mcp/mobius/opis/data/profilers/ProfilerDimTick.java b/mcp/mobius/opis/data/profilers/ProfilerDimTick.java index 33ba0ab..c6a0b20 100644 --- a/mcp/mobius/opis/data/profilers/ProfilerDimTick.java +++ b/mcp/mobius/opis/data/profilers/ProfilerDimTick.java @@ -13,20 +13,22 @@ public class ProfilerDimTick implements IProfilerBase { public HashMap data = new HashMap(); @Override - public void start(World key) { - if (key.isRemote) return; + public void start(Object key) { + World world = (World)key; + if (world.isRemote) return; - if (!data.containsKey(key.provider.dimensionId)) - data.put(key.provider.dimensionId, new DescriptiveStatistics(20)); + if (!data.containsKey(world.provider.dimensionId)) + data.put(world.provider.dimensionId, new DescriptiveStatistics(20)); clock.start(); } @Override - public void stop(World key) { - if (key.isRemote) return; + public void stop(Object key) { + World world = (World)key; + if (world.isRemote) return; clock.stop(); - data.get(key.provider.dimensionId).addValue((double)clock.timeDelta); + data.get(world.provider.dimensionId).addValue((double)clock.timeDelta); } /* UNUSED */ @@ -35,7 +37,8 @@ public class ProfilerDimTick implements IProfilerBase { @Override public void stop() {/*UNUSED*/} @Override - public void start(Integer key) {/*UNUSED*/} + public void start(Object key1, Object key2) {/*UNUSED*/} @Override - public void stop(Integer key) {/*UNUSED*/} + public void stop(Object key1, Object key2) {/*UNUSED*/} + } diff --git a/mcp/mobius/opis/data/server/WorldTickProfiler.java b/mcp/mobius/opis/data/server/WorldTickProfiler.java index 54c19b2..79defd4 100644 --- a/mcp/mobius/opis/data/server/WorldTickProfiler.java +++ b/mcp/mobius/opis/data/server/WorldTickProfiler.java @@ -33,36 +33,4 @@ public final class WorldTickProfiler extends AbstractProfiler implements IProfil this.clock.stop(); GlobalTimingManager.INSTANCE.addStat(id, this.clock.timeDelta, GlobalTimingManager.INSTANCE.worldTickStats); } - - @Override - public void startDim(int dim, String subsection) { - if (!clocksDim.contains(dim, subsection)){ - clocksDim.put(dim, subsection, new Clock()); - } - clocksDim.get(dim, subsection).start(); - } - - @Override - public void stopDim(int dim, String subsection) { - clocksDim.get(dim, subsection).stop(); - GlobalTimingManager.INSTANCE.addStat(dim, subsection, clocksDim.get(dim, subsection).timeDelta); - } - - @Override - public void startChunk(int dim, ChunkCoordIntPair chunk, String subsection) { - CoordinatesChunk coord = new CoordinatesChunk(dim, chunk); - if (!clocksChunk.contains(coord, subsection)){ - clocksChunk.put(coord, subsection, new Clock()); - } - clocksChunk.get(coord, subsection).start(); - - } - - @Override - public void stopChunk(int dim, ChunkCoordIntPair chunk, String subsection) { - CoordinatesChunk coord = new CoordinatesChunk(dim, chunk); - clocksChunk.get(coord, subsection).stop(); - GlobalTimingManager.INSTANCE.addStat(coord, subsection, clocksChunk.get(coord, subsection).timeDelta); - - } } diff --git a/mcp/mobius/opis/events/OpisServerTickHandler.java b/mcp/mobius/opis/events/OpisServerTickHandler.java index 6e5f356..edb6a61 100644 --- a/mcp/mobius/opis/events/OpisServerTickHandler.java +++ b/mcp/mobius/opis/events/OpisServerTickHandler.java @@ -136,14 +136,6 @@ public class OpisServerTickHandler implements ITickHandler { OpisPacketHandler.sendFullUpdate(player); } - for(Table.Cell cell : GlobalTimingManager.INSTANCE.getStatsDim().cellSet()){ - System.out.printf("[ %4d ] %20s : %.3f µs\n", cell.getRowKey(), cell.getColumnKey(), cell.getValue()); - } - - for(Table.Cell cell : GlobalTimingManager.INSTANCE.getStatsDimPerSection().cellSet()){ - System.out.printf("[ %4d ] %20s : %.3f µs\n", cell.getRowKey(), cell.getColumnKey(), cell.getValue()); - } - for(String key : NetworkProfiler.INSTANCE.stats.keySet()){ System.out.printf("[ %s ] : %.3f µs\n", key, NetworkProfiler.INSTANCE.stats.get(key).getGeometricMean()); }