ice icon indicating copy to clipboard operation
ice copied to clipboard

Implement RTT calculation for candidate pair stats

Open kcaffrey opened this issue 3 years ago • 2 comments

Implement CurrentRoundTripTime, TotalRoundTripTime, RequestsSent, and ResponsesReceived for candidate pair statistics.

This change on its own is not quite enough to get stats working end to end. Notably, (*Agent).GetSelectedCandidatePair() copies both candidates, which due to internally marshaling and unmarshaling the candidate to implement the copy, ends up generating new candidate ids.

Because pion/webrtc stores stats in a map based on candidate ids, this means that it is currently impractical to actually access these stats.

kcaffrey avatar Feb 11 '22 01:02 kcaffrey

Codecov Report

Merging #420 (1c3436d) into master (4f34006) will increase coverage by 0.02%. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #420      +/-   ##
==========================================
+ Coverage   79.31%   79.33%   +0.02%     
==========================================
  Files          33       33              
  Lines        3650     3659       +9     
==========================================
+ Hits         2895     2903       +8     
- Misses        589      590       +1     
  Partials      166      166              
Flag Coverage Δ
go 79.33% <100.00%> (+0.02%) :arrow_up:
wasm 26.70% <15.15%> (+0.07%) :arrow_up:

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
agent.go 81.25% <100.00%> (+0.40%) :arrow_up:
agent_stats.go 84.37% <100.00%> (ø)
candidatepair.go 84.48% <100.00%> (+1.46%) :arrow_up:
selection.go 80.37% <100.00%> (-1.71%) :arrow_down:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 4f34006...1c3436d. Read the comment docs.

codecov[bot] avatar Feb 11 '22 01:02 codecov[bot]

Hmm... you're using just the last sample, which might yield an extremely noisy signal. Shouldn't we be computing an exponential average instead? (Please see Figure 6 of https://arxiv.org/pdf/1403.3488.pdf for an illustration of what I mean.)

jech avatar Apr 24 '22 12:04 jech