Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make mbpsSendRate stat independent on srt_bstats(..) call interval #1812

Open
maxsharabayko opened this issue Feb 17, 2021 · 0 comments · May be fixed by #3009
Open

Make mbpsSendRate stat independent on srt_bstats(..) call interval #1812

maxsharabayko opened this issue Feb 17, 2021 · 0 comments · May be fixed by #3009
Assignees
Labels
[core] Area: Changes in SRT library core Type: Enhancement Indicates new feature requests
Milestone

Comments

@maxsharabayko
Copy link
Collaborator

Currently mbpsSendRate and mbpsRecvRate are calculated based on the interval between srt_bstats(..) calls with clear argument set to true. The argument tells whether to reset interval-based stats like byteSent, or not.

double interval = count_microseconds(currtime - m_stats.tsLastSampleTime);
perf->mbpsSendRate = double(perf->byteSent) * 8.0 / interval;
perf->mbpsRecvRate = double(perf->byteRecv) * 8.0 / interval;

If interval-based stats are not reset, the bitrate calculation interval also grows, making mbpsXSendRate averaged over a constantly increasing range.

Consider using some averaging over one second. For example, storing a moving window of ten byteSentTotal values on every 100 ms, then calculate the rate over the last second using edge values.
Might be worth smoothing this value additionally using a moving average.

SRT Version: 1.4.2 and prior

@maxsharabayko maxsharabayko added Type: Enhancement Indicates new feature requests [core] Area: Changes in SRT library core labels Feb 17, 2021
@maxsharabayko maxsharabayko added this to the Parking Lot milestone Feb 17, 2021
@npanhaleux npanhaleux self-assigned this Aug 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[core] Area: Changes in SRT library core Type: Enhancement Indicates new feature requests
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants