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: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1522>
This commit is contained in:
Martin Nordholts 2024-03-14 07:40:31 +01:00 committed by GStreamer Marge Bot
parent a870d60621
commit 5d7e068a8b

View file

@ -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;
}
}