Open 3D Engine AzNetworking API Reference 23.10.0
O3DE is an open-source, fully-featured, high-fidelity, modular 3D engine for building games and simulations, available to every industry.
AzNetworking::DatarateMetrics Class Reference

used to track datarate related metrics for a given connection with respect to time. More...

#include <ConnectionMetrics.h>

Public Member Functions

 DatarateMetrics (AZ::TimeMs maxSampleTimeMs)
 
void LogPacket (uint32_t byteCount, AZ::TimeMs currentTimeMs)
 
void LogPacketLost ()
 Invoked whenever a packet has determined to be lost.
 
float GetBytesPerSecond () const
 
float GetLossRatePercent () const
 

Detailed Description

used to track datarate related metrics for a given connection with respect to time.

Constructor & Destructor Documentation

◆ DatarateMetrics()

AzNetworking::DatarateMetrics::DatarateMetrics ( AZ::TimeMs  maxSampleTimeMs)
inline

Constructor.

Parameters
maxSampleTimeMsthe period of time in milliseconds to attempt to smooth datarate over

Member Function Documentation

◆ GetBytesPerSecond()

float AzNetworking::DatarateMetrics::GetBytesPerSecond ( ) const

Retrieve a sample of the datarate being incurred by this connection in bytes per second.

Returns
datarate for traffic sent to or from the connection in bytes per second

◆ GetLossRatePercent()

float AzNetworking::DatarateMetrics::GetLossRatePercent ( ) const

Returns the estimated packet loss rate as a percentage of packets.

Returns
the estimated percentage loss rate

◆ LogPacket()

void AzNetworking::DatarateMetrics::LogPacket ( uint32_t  byteCount,
AZ::TimeMs  currentTimeMs 
)

Invoked whenever traffic is handled by the connection this instance is responsible for.

Parameters
byteCountnumber of bytes sent through the connection
currentTimeMscurrent process time in milliseconds

The documentation for this class was generated from the following files: