@ceeblue/webrtc-client
    Preparing search index...

    Interface IStats

    IStats is the interface used to implement statistics seralization The serialized object can then be sent to a server for analysis with Telemetry.

    // MyStats implementation
    class MyStats extends IStats {
    constructor(obj) {
    this._obj = obj;
    // Subscribe to onClose event to signal object release (will stop this stats report)
    obj.onClose = () => this.onRelease();
    }
    async serialize() {
    // serialize stats to a JSON object {recvBytes, sendBytes}
    return {
    recvBytes: this._obj.recvBytes,
    sendBytes: this._obj.sendBytes
    }
    }
    }
    interface IStats {
        log: ILog;
        onRelease(): void;
        serialize(): Promise<string | object | ArrayBuffer>;
    }

    Hierarchy (View Summary)

    Implemented by

    Index

    Properties

    Methods

    Events

    Properties

    log: ILog

    Start a log

    a Log object with the levels of log to call

    Methods

    • Implements this function to define how to serialize data. The function must return the metrics object or reject the Promise if the serialization is not possible.

      Returns Promise<string | object | ArrayBuffer>

      an async string for a text/plain response, an object for a JSON response, or ArrayBuffer for a binary response

    Events