docs.unity3d.com
    Show / Hide Table of Contents

    Class QosStats

    Inheritance
    Object
    QosStats
    Namespace: Unity.Networking.QoS
    Syntax
    public class QosStats

    Constructors

    QosStats(Int32, Single)

    Declaration
    public QosStats(int numResults, float weightOfCurrentResult)
    Parameters
    Type Name Description
    Int32 numResults
    Single weightOfCurrentResult

    Methods

    AddResult(String, QosResult)

    Declaration
    [Obsolete("Use QosStats.ProcessResult() instead.")]
    public void AddResult(string key, QosResult result)
    Parameters
    Type Name Description
    String key
    QosResult result

    InRangeInclusive(Single, Single, Single)

    Declaration
    public static bool InRangeInclusive(float value, float min, float max)
    Parameters
    Type Name Description
    Single value
    Single min
    Single max
    Returns
    Type Description
    Boolean

    ProcessResult(String, QosResult)

    Declaration
    public void ProcessResult(string key, QosResult result)
    Parameters
    Type Name Description
    String key
    QosResult result

    TryGetAllResults(String, out QosStatsResult[])

    Get an array of all the results currently being tracked for the given key.

    Declaration
    public bool TryGetAllResults(string key, out QosStatsResult[] results)
    Parameters
    Type Name Description
    String key

    Key to identify the server (e.g. IP:port)

    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. If false, results will be null, else it will contain the array of results.

    Remarks
    • The results, if present, are ordered newest to oldest.

    TryGetWeightedAverage(String, out QosStatsResult)

    Get the weighted rolling average for the given key.

    Declaration
    public bool TryGetWeightedAverage(string key, out QosStatsResult result)
    Parameters
    Type Name Description
    String key

    Key to identify the server (e.g. IP:port)

    QosStatsResult result

    The weighted rolling average for the given key. null if server not found.

    Returns
    Type Description
    Boolean

    true if the record was found, false otherwise

    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023