Open 3D Engine AzNetworking API Reference
24.09
O3DE is an open-source, fully-featured, high-fidelity, modular 3D engine for building games and simulations, available to every industry.
|
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 |
used to track datarate related metrics for a given connection with respect to time.
|
inline |
Constructor.
maxSampleTimeMs | the period of time in milliseconds to attempt to smooth datarate over |
float AzNetworking::DatarateMetrics::GetBytesPerSecond | ( | ) | const |
Retrieve a sample of the datarate being incurred by this connection in bytes per second.
float AzNetworking::DatarateMetrics::GetLossRatePercent | ( | ) | const |
Returns the estimated packet loss rate as a percentage of packets.
void AzNetworking::DatarateMetrics::LogPacket | ( | uint32_t | byteCount, |
AZ::TimeMs | currentTimeMs | ||
) |
Invoked whenever traffic is handled by the connection this instance is responsible for.
byteCount | number of bytes sent through the connection |
currentTimeMs | current process time in milliseconds |