Contents
Interface PacketStatsRecorder
- All Known Implementing Classes:
PacketStatsRecorderImpl
public interface PacketStatsRecorder
Interface for recording packet statistics at the wire level.
Called by PacketIO during frame read/write to capture both
uncompressed (serialized) and compressed (wire) sizes.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfacePer-packet statistics entry.static final recordStatistics for a recent time window. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final io.netty.util.AttributeKey<PacketStatsRecorder> Channel attribute key for accessing the recorder from encoder/decoder.static final PacketStatsRecorderNo-op implementation for when stats recording is not needed. -
Method Summary
Modifier and TypeMethodDescriptiongetEntry(int packetId) Get the stats entry for a specific packet ID.voidrecordReceive(int packetId, int uncompressedSize, int compressedSize) Record statistics for an inbound packet.voidrecordSend(int packetId, int uncompressedSize, int compressedSize) Record statistics for an outbound packet.
-
Field Details
-
CHANNEL_KEY
Channel attribute key for accessing the recorder from encoder/decoder. -
NOOP
No-op implementation for when stats recording is not needed.
-
-
Method Details
-
recordSend
void recordSend(int packetId, int uncompressedSize, int compressedSize) Record statistics for an outbound packet.- Parameters:
packetId- the packet IDuncompressedSize- the serialized size before compressioncompressedSize- the wire size after compression (same as uncompressed if not compressed)
-
recordReceive
void recordReceive(int packetId, int uncompressedSize, int compressedSize) Record statistics for an inbound packet.- Parameters:
packetId- the packet IDuncompressedSize- the decompressed payload sizecompressedSize- the wire size before decompression (same as uncompressed if not compressed)
-
getEntry
Get the stats entry for a specific packet ID.
-