diff --git a/client/scenes/stream.cpp b/client/scenes/stream.cpp index ac43baa3..099a837c 100644 --- a/client/scenes/stream.cpp +++ b/client/scenes/stream.cpp @@ -295,8 +295,10 @@ scenes::stream::metric scenes::stream::get_metrics(XrTime predicted_display_time uint64_t tx = network_session->bytes_sent(); 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; bytes_received = rx; bytes_sent = tx; diff --git a/client/scenes/stream.h b/client/scenes/stream.h index fca48e33..0dc9a7be 100644 --- a/client/scenes/stream.h +++ b/client/scenes/stream.h @@ -139,6 +139,8 @@ private: uint64_t bytes_sent = 0; uint64_t bytes_received = 0; + float bandwidth_rx = 0; + float bandwidth_tx = 0; struct metric {