Skip to main content
Version: 3.0

struct NetcodeSessionStats

(Niantic.Lightship.SharedAR.Netcode.LightshipNetcodeTransport.NetcodeSessionStats)

Overview

Session stats describing network usage.

struct NetcodeSessionStats {
// fields

ulong TotalBytesSent;
ulong TotalBytesReceived;
uint TotalMessagesSent;
uint TotalMessagesReceived;
int PeerCount;
float Timestamp;

// methods

static void GetPerSecondStats(
NetcodeSessionStats stats1,
NetcodeSessionStats stats2,
out float bytesSentPerSec,
out float messagesSentPerSec,
out float bytesReceivedPerSec,
out float messagesReceivedPerSec
);
};

Detailed Documentation

Session stats describing network usage.

Methods

GetPerSecondStats

static void GetPerSecondStats(
NetcodeSessionStats stats1,
NetcodeSessionStats stats2,
out float bytesSentPerSec,
out float messagesSentPerSec,
out float bytesReceivedPerSec,
out float messagesReceivedPerSec
)

Compare two NetcodeSessionStats to calculate bandwidth usage. Order is determined automatically.

    Parameters:

    stats1 - First stat snapshot.

    stats2 - Second stat snapshot.

    bytesSentPerSec - Outgoing bytes per second.

    messagesSentPerSec - Outgoing messages per second.

    bytesReceivedPerSec - Incoming bytes per second.

    messagesReceivedPerSec - Incoming messages per second.