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

Add network metrics to RPC #5

Open
gavv opened this issue Oct 9, 2024 · 0 comments
Open

Add network metrics to RPC #5

gavv opened this issue Oct 9, 2024 · 0 comments
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Contributions are welcome

Comments

@gavv
Copy link
Member

gavv commented Oct 9, 2024

We need a way to obtain network metrics of a virtual device via RPC.

RPC allows to fetch device info (RvDeviceInfo), which includes sender and receiver config:

    // Network configuration of device.
    // Parameters of network sender or receiver.
    oneof NetworkConfig
    {
        // Configuration for sender device.
        // Should be used if device type is RV_DEVICE_TYPE_SENDER.
        RvSenderConfig sender_config = 7;

        // Configuration for receiver device.
        // Should be used if device type is RV_DEVICE_TYPE_RECEIVER.
        RvReceiverConfig receiver_config = 8;
    }

Similarly, we can add NetworkMetrics field, and fill it with sender/receiver metrics (depending on devices type), that are available from the streaming library. (Roc Toolkit 0.4 exports only e2e_latency and connection_count metrics; 0.5 will export more metrics).

Related files:

  • rpc/driver_protocol.proto - defines RPC interface and RvDeviceInfo
  • driver/device_defs.hpp - defines C++ structs including DeviceInfo
  • driver/rpc_serdes.cpp - defines mapping between C++ structs and protobuf RPC messages
  • driver/device.hpp - defines object created for every device, it returns device info, and holds a reference to Transceiver (a base class for Sender and Receiver)
  • driver/sender.hpp - created for sender devices; holds a pointer to roc_sender, from where we can obtain sender metrics (via roc_sender_query())
  • driver/receiver.hpp - created for receiver devices; holds a pointer to roc_receiver, from where we can obtain receiver metrics (via roc_receiver_query())
  • tool/print.cpp - code that prints device info to console on the client side, we'll need to print metrics here

After updating these files, metrics should appear in the output of roc-vad device list --detail and roc-vad device show commands.

See also:

@gavv gavv added enhancement New feature or request good first issue Good for newcomers help wanted Contributions are welcome labels Oct 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Contributions are welcome
Projects
None yet
Development

No branches or pull requests

1 participant