mirror of
https://github.com/GTNewHorizons/Opis.git
synced 2026-11-28 07:55:49 +00:00
Added basic Packet profiling (UP/DOWN)
This commit is contained in:
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();
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user