Class QosStats
Namespace: Unity.Networking.QoS
Syntax
public class QosStats
Constructors
QosStats(UInt32, Single)
Declaration
public QosStats(uint numResults, float weightOfCurrentResult)
Parameters
Type | Name | Description |
---|---|---|
UInt32 | numResults | |
Single | weightOfCurrentResult |
Methods
AddResult(String, QosResult)
Add a result to the weighted rolling average history.
Declaration
public void AddResult(string ipAndPort, QosResult result)
Parameters
Type | Name | Description |
---|---|---|
String | ipAndPort | IP:Port string to identify where the results go |
QosResult | result | The result to add to the history. This result becomes the current result. |
TryGetAllResults(String, out QosStatsResult[])
Get an array of all the results currently being tracked for the given key.
Declaration
public bool TryGetAllResults(string ipAndPort, out QosStatsResult[] results)
Parameters
Type | Name | Description |
---|---|---|
String | ipAndPort | IP:Port string to get results for |
QosStatsResult[] | results | Array of results (unweighted) used to compute the weighted average. |
Returns
Type | Description |
---|---|
Boolean | true if record(s) were found, false if key does not exist or no valid records found |
Remarks
There is no way to determine which results correspond to the most recently added results.
TryGetWeightedAverage(String, out QosStatsResult)
Get the weighted rolling average for the given key.
Declaration
public bool TryGetWeightedAverage(string ipAndPort, out QosStatsResult result)
Parameters
Type | Name | Description |
---|---|---|
String | ipAndPort | IP:Port string to get results for |
QosStatsResult | result | The weighted rolling average for the given ipAndPort |
Returns
Type | Description |
---|---|
Boolean | true if the record was found, false otherwise |