DataStatBandwidth Class

Namespace: id3.Devices

Definition

(C++) Provides functionality for tracking and calculating the bandwidth and data transfer rates of a system or application component.
Intended for use in performance analysis, this class allows for detailed monitoring of data throughput over time.
typedef struct id3DevicesDataStatBandwidth *ID3_DEVICES_DATA_STAT_BANDWIDTH;

Usage

ID3_DEVICES_DATA_STAT_BANDWIDTH hDataStatBandwidth{};
int err = id3DevicesDataStatBandwidth_Initialize(&hDataStatBandwidth);
if (err == ID3_SUCCESS) {
    // ...
    id3DevicesDataStatBandwidth_Dispose(&hDataStatBandwidth);
}

Methods

Name

Description

addData

Adds a data entry to the bandwidth calculation, including the size of the data and the timestamp when it was received or processed.

decKeepAlive

Decrements the keep-alive counter and determines if the connection or data stream should remain active based on the counter’s value.

getBandwidth

Calculates and retrieves the current bandwidth based on the added data and their timestamps.

getBps

Computes and returns the current data processing rate in terms of blocks per second, providing insight into data throughput efficiency.

setDataStatSize

Initializes the internal storage with a specified size for data computation, defining the capacity for data tracking.