From 5d7e068a8b89ecfe82df92fe0f8965fe577cef83 Mon Sep 17 00:00:00 2001 From: Martin Nordholts Date: Thu, 14 Mar 2024 07:40:31 +0100 Subject: [PATCH] rtpgccbwe: Add increasing_duration and counter to existing gst::log!() Add `self.increasing_duration` and `self.increasing_counter` to logs to provide more details of why `overuse_filter()` determines overuse of network. To get access to the latest values of those fields we need to move down the log call. But that is fine, since no other logged data is modified between the old and new location of `gst::log!()`. We do not bother logging `self.last_overuse_estimate` since that is simply the previously logged value of `estimate`. We must put the log call before we write the latest value to it though, in case we want to log it in the future. Part-of: --- net/rtp/src/gcc/imp.rs | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/net/rtp/src/gcc/imp.rs b/net/rtp/src/gcc/imp.rs index 0f108bf4..30ca1697 100644 --- a/net/rtp/src/gcc/imp.rs +++ b/net/rtp/src/gcc/imp.rs @@ -619,14 +619,6 @@ impl Detector { let now = time::Instant::now(); let delta = now - self.last_use_detector_update; self.last_use_detector_update = now; - gst::log!( - CAT, - "{:?} - self.estimate {} - estimate: {} - th: {}", - th_usage, - self.estimate, - estimate, - self.threshold - ); match th_usage { NetworkUsage::Over => { self.increasing_duration += delta; @@ -646,6 +638,16 @@ impl Detector { self.usage = th_usage; } } + gst::log!( + CAT, + "{:?} - self.estimate {} - estimate: {} - th: {} - inc_dur: {} - inc_cnt: {}", + th_usage, + self.estimate, + estimate, + self.threshold, + self.increasing_duration, + self.increasing_counter, + ); self.last_overuse_estimate = estimate; } }