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

Added improvements for recvlive to make it suitable for performance testing #2320

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

ethouris
Copy link
Collaborator

This adds a possibility to manage simple options for the program (also for the future) and adds one option -echo quiet that blocks most of the messages printed on stdout that could influence performance.

Copy link
Collaborator

@maxsharabayko maxsharabayko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The main(..) function of an example application grows by 100 LOC to parse input arguments.
Please move argument parsing logic to a dedicated function so it does not obstruct reading the code related to SRT API calls.

@maxsharabayko
Copy link
Collaborator

Better, but still 50 lines in main() that are not directly related to the SRT API usage in the example app.

struct Config {
    Config()
        : opt_quiet(false)
        , service("9000")
    {}

    bool opt_quiet;
    string service;
};

// Not exactly nice to fill Config by reference. Better to return. But for the same of simplicity
// and not catching exceptions in main() should be fine for the example code.
// Returns false on command-line error, true otherwise.
bool ParseOptions(const vector<string>& cmdline_args, Config &cfg);

int main(int argc, char* argv[])
{
    //...
    if (!ParseOptions(args))
        return 1;

@maxsharabayko maxsharabayko added this to the v1.4.5 milestone Apr 29, 2022
@maxsharabayko maxsharabayko added Type: Maintenance Work required to maintain or clean up the code [apps] Area: Test applications related improvements labels Apr 29, 2022
@ethouris
Copy link
Collaborator Author

ethouris commented Apr 29, 2022

Well, I even like it. The parser function can be even a method ;)

BTW. As per that mutable reference, it was a mistake. Changed to const already.

@maxsharabayko maxsharabayko modified the milestones: v1.5.0, Backlog May 17, 2022
Copy link

codecov bot commented Feb 16, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (e0d4227) 67.01% compared to head (5c0f315) 66.79%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2320      +/-   ##
==========================================
- Coverage   67.01%   66.79%   -0.23%     
==========================================
  Files         103      103              
  Lines       20476    20476              
==========================================
- Hits        13723    13677      -46     
- Misses       6753     6799      +46     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[apps] Area: Test applications related improvements Type: Maintenance Work required to maintain or clean up the code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants