Removed display of global ent update (was profiling the profiler).

Added priviliged user list.
This commit is contained in:
ProfMobius committed 2014-03-20 16:49:49 +01:00
1 parent 5235f61f83
commit aadf0f736f
11 files changed
+305 -264

No files matched your search

@@ -0,0 +1,39 @@
package mcp.mobius.opis.data.managers;
import java.util.HashMap;
import mcp.mobius.opis.data.holders.stats.StatsWorld;
public class GlobalTimingManager {
public static HashMap<Integer, StatsWorld> worldTickStats = new HashMap<Integer, StatsWorld>();
public static HashMap<Integer, StatsWorld> entUpdateStats = new HashMap<Integer, StatsWorld>();
/* Add an entity to the stat array, with timing data */
public static void addWorldTickStat(int id, long timing){
if (!(worldTickStats.containsKey(id)))
worldTickStats.put(id, new StatsWorld(id));
worldTickStats.get(id).addMeasure(timing);
}
public static void addEntUpdateStat(int id, long timing){
if (!(entUpdateStats.containsKey(id)))
entUpdateStats.put(id, new StatsWorld(id));
entUpdateStats.get(id).addMeasure(timing);
}
public static double getTotalWorldTickStats(){
double total = 0D;
for (Integer dim : worldTickStats.keySet())
total += worldTickStats.get(dim).getGeometricMean();
return total;
}
public static double getTotalEntUpdateStats(){
double total = 0D;
for (Integer dim : entUpdateStats.keySet())
total += entUpdateStats.get(dim).getGeometricMean();
return total;
}
}