Added basic Packet profiling (UP/DOWN)

This commit is contained in:
ProfMobius committed 2014-03-21 13:56:35 +01:00
1 parent af0d3ac2cb
commit d03b4bc1f1
9 files changed
+243 -113

No files matched your search

@@ -0,0 +1,26 @@
package mcp.mobius.opis.data.server;
import net.minecraft.network.packet.Packet;
import mcp.mobius.mobiuscore.profiler.IProfilerPacket;
public class PacketProfiler implements IProfilerPacket {
private static PacketProfiler _instance = new PacketProfiler();
public static PacketProfiler instance() {return _instance;}
public long dataSizeOut = 0;
public long dataSizeIn = 0;
@Override
public void addPacketOut(Packet packet) {
if (packet != null)
dataSizeOut += packet.getPacketSize();
}
@Override
public void addPacketIn(Packet packet) {
if (packet != null)
dataSizeIn += packet.getPacketSize();
}
}