Low pass filter on the bandwidth measurement
This commit is contained in:
@@ -295,8 +295,10 @@ scenes::stream::metric scenes::stream::get_metrics(XrTime predicted_display_time
|
|||||||
uint64_t tx = network_session->bytes_sent();
|
uint64_t tx = network_session->bytes_sent();
|
||||||
|
|
||||||
float dt = (predicted_display_time - last_metric_time) * 1e-9f;
|
float dt = (predicted_display_time - last_metric_time) * 1e-9f;
|
||||||
float bandwidth_rx = float(rx - bytes_received) / dt;
|
|
||||||
float bandwidth_tx = float(tx - bytes_sent ) /dt;
|
bandwidth_rx = 0.8 * bandwidth_rx + 0.2 * float(rx - bytes_received) / dt;
|
||||||
|
bandwidth_tx = 0.8 * bandwidth_tx + 0.2 * float(tx - bytes_sent ) /dt;
|
||||||
|
|
||||||
last_metric_time = predicted_display_time;
|
last_metric_time = predicted_display_time;
|
||||||
bytes_received = rx;
|
bytes_received = rx;
|
||||||
bytes_sent = tx;
|
bytes_sent = tx;
|
||||||
|
|||||||
@@ -139,6 +139,8 @@ private:
|
|||||||
|
|
||||||
uint64_t bytes_sent = 0;
|
uint64_t bytes_sent = 0;
|
||||||
uint64_t bytes_received = 0;
|
uint64_t bytes_received = 0;
|
||||||
|
float bandwidth_rx = 0;
|
||||||
|
float bandwidth_tx = 0;
|
||||||
|
|
||||||
struct metric
|
struct metric
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user