Struct SnapshotPacketLossStatistics
Stores packet loss causes and statistics for all received snapshots. Thus, client-only. Access via NetworkSnapshotAck.
Inherited Members
Namespace: Unity.NetCode
Assembly: Unity.NetCode.dll
Syntax
public struct SnapshotPacketLossStatistics
Remarks
Very similar approach to Unity.Networking.Transport.UnreliableSequencedPipelineStage Statistics.
Fields
NumPacketsCulledAsArrivedOnSameFrame
The Netcode package can only process one snapshot per render frame. If 2 or more arrive on the same frame, we'll delete all but one, without processing them. Therefore, this form of packet loss is common when your connection jitter is higher than a NetworkTickRate interval. E.g. If your jitter is ±20ms, but your NetworkTickRate is 60Hz (16.67ms), you can expect a lot of packet clobbering.
Declaration
public ulong NumPacketsCulledAsArrivedOnSameFrame
Field Value
Type | Description |
---|---|
ulong |
Remarks
This is also called a "Packet Burst".
NumPacketsCulledOutOfOrder
Counts the number of snapshot packets dropped (i.e. "culled") due to invalid SequenceId. I.e. Implies the packet arrived, but out of order.
Declaration
public ulong NumPacketsCulledOutOfOrder
Field Value
Type | Description |
---|---|
ulong |
NumPacketsDroppedNeverArrived
Detects gaps in CurrentSnapshotSequenceId to determine real packet loss.
Declaration
public ulong NumPacketsDroppedNeverArrived
Field Value
Type | Description |
---|---|
ulong |
NumPacketsReceived
Count of snapshot packets received - on the client - from the server.
Declaration
public ulong NumPacketsReceived
Field Value
Type | Description |
---|---|
ulong |
Properties
ArrivedOnTheSameFrameClobberedPacketLossPercent
Percentage of all snapshot packets - that we assume must have been sent to us (based on SequenceId) - which are culled due to arriving on the same frame as another snapshot.
Declaration
public double ArrivedOnTheSameFrameClobberedPacketLossPercent { get; }
Property Value
Type | Description |
---|---|
double |
CombinedPacketLossCount
Count of packets lost in some form.
Declaration
public ulong CombinedPacketLossCount { get; }
Property Value
Type | Description |
---|---|
ulong |
CombinedPacketLossPercent
Percentage of all snapshot packets - that we assume must have been sent to us (based on SequenceId) - which are dropped (for any reason).
Declaration
public double CombinedPacketLossPercent { get; }
Property Value
Type | Description |
---|---|
double |
NetworkPacketLossPercent
Percentage of all snapshot packets - that we assume must have been sent to us (based on SequenceId) - which are lost due to network-caused packet loss.
Declaration
public double NetworkPacketLossPercent { get; }
Property Value
Type | Description |
---|---|
double |
OutOfOrderPacketLossPercent
Percentage of all snapshot packets - that we assume must have been sent to us (based on SequenceId) - which are lost due to arriving out of order (and thus being culled).
Declaration
public double OutOfOrderPacketLossPercent { get; }
Property Value
Type | Description |
---|---|
double |
Methods
ToFixedString()
Dumps all the statistic info.
Declaration
public FixedString512Bytes ToFixedString()
Returns
Type | Description |
---|---|
FixedString512Bytes | Dumps all the statistic info. |
Operators
operator +(SnapshotPacketLossStatistics, SnapshotPacketLossStatistics)
Adds two SnapshotPacketLossStatistics
Declaration
public static SnapshotPacketLossStatistics operator +(SnapshotPacketLossStatistics a, SnapshotPacketLossStatistics b)
Parameters
Type | Name | Description |
---|---|---|
SnapshotPacketLossStatistics | a | First SnapshotPacketLossStatistics |
SnapshotPacketLossStatistics | b | Second SnapshotPacketLossStatistics |
Returns
Type | Description |
---|---|
SnapshotPacketLossStatistics | The resulting sum of the two SnapshotPacketLossStatistics. |
operator -(SnapshotPacketLossStatistics, SnapshotPacketLossStatistics)
Subtracts two SnapshotPacketLossStatistics
Declaration
public static SnapshotPacketLossStatistics operator -(SnapshotPacketLossStatistics a, SnapshotPacketLossStatistics b)
Parameters
Type | Name | Description |
---|---|---|
SnapshotPacketLossStatistics | a | First SnapshotPacketLossStatistics |
SnapshotPacketLossStatistics | b | Second SnapshotPacketLossStatistics |
Returns
Type | Description |
---|---|
SnapshotPacketLossStatistics | The resulting difference of the two SnapshotPacketLossStatistics. |