Low pass filter on the bandwidth measurement

This commit is contained in:
Guillaume Meunier
2024-02-18 09:03:46 +01:00
parent 83afaa0681
commit 554b62e643
2 changed files with 6 additions and 2 deletions
+4 -2
View File
@@ -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;
+2
View File
@@ -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
{