use of com.kahzerx.kahzerxmod.profiler.instances.ProfilerResult in project KahzerxMod by otakucraft.
the class BlockEntitiesProfiler method onTick.
@Override
public void onTick(MinecraftServer server, String id) {
blockEntityList.add(new BlockEntityInstance("", "", 0.0D, 0.0D, 0.0D));
this.addResult(server.getTicks(), new ProfilerResult("block_entities", id, new ArrayList<>(blockEntityList)));
blockEntityList.clear();
}
use of com.kahzerx.kahzerxmod.profiler.instances.ProfilerResult in project KahzerxMod by otakucraft.
the class TPSProfiler method onTick.
@Override
public void onTick(MinecraftServer server, String id) {
if (server.getTicks() % TPS_SAMPLE_INTERVAL != 0) {
this.addResult(server.getTicks(), new ProfilerResult("tps", id, new TPSInstance(tps5Sec(), tps10Sec(), tps1Min(), tps5Min(), tps10Min())));
return;
}
long now = System.nanoTime();
if (this.lastTickTime == 0) {
this.addResult(server.getTicks(), new ProfilerResult("tps", id, new TPSInstance(20.0D, 20.0D, 20.0D, 20.0D, 20.0D)));
this.lastTickTime = now;
return;
}
long diff = now - this.lastTickTime;
BigDecimal currentTps = TPS_BASE.divide(new BigDecimal(diff), 30, RoundingMode.HALF_UP);
BigDecimal total = currentTps.multiply(new BigDecimal(diff));
for (TpsRollingAverage rollingAverage : this.tpsAverages) {
rollingAverage.add(currentTps, diff, total);
}
this.lastTickTime = now;
this.addResult(server.getTicks(), new ProfilerResult("tps", id, new TPSInstance(tps5Sec(), tps10Sec(), tps1Min(), tps5Min(), tps10Min())));
}
use of com.kahzerx.kahzerxmod.profiler.instances.ProfilerResult in project KahzerxMod by otakucraft.
the class ChunkProfiler method onTick.
@Override
public void onTick(MinecraftServer server, String id) {
chunkList.add(new ChunkInstance("", 0, 0));
this.addResult(server.getTicks(), new ProfilerResult("loaded_chunks", id, new ArrayList<>(chunkList)));
chunkList.clear();
}
use of com.kahzerx.kahzerxmod.profiler.instances.ProfilerResult in project KahzerxMod by otakucraft.
the class EntityProfiler method onTick.
@Override
public void onTick(MinecraftServer server, String id) {
entityList.add(new EntityInstance("", "", 0.0D, 0.0D, 0.0D));
this.addResult(server.getTicks(), new ProfilerResult("entities", id, new ArrayList<>(entityList)));
entityList.clear();
}
use of com.kahzerx.kahzerxmod.profiler.instances.ProfilerResult in project KahzerxMod by otakucraft.
the class MSPTProfiler method onTick.
@Override
public void onTick(MinecraftServer server, String id) {
double MSPT = MathHelper.average(server.lastTickLengths) * 1.0E-6D;
this.addResult(server.getTicks(), new ProfilerResult("mspt", id, new MSPTInstance(MSPT)));
}
Aggregations