Skip to content

Add timeout parameter to ICEAgent.get_stats/2#108

Merged
roznawsk merged 2 commits into
masterfrom
ice-agent-get-stats-timeout
Jul 13, 2026
Merged

Add timeout parameter to ICEAgent.get_stats/2#108
roznawsk merged 2 commits into
masterfrom
ice-agent-get-stats-timeout

Conversation

@roznawsk

Copy link
Copy Markdown
Member

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR extends the public ExICE.ICEAgent.get_stats API to allow callers to control the GenServer.call/3 timeout when retrieving ICE statistics, which can help avoid unwanted call timeouts (or allow faster failure) depending on runtime conditions.

Changes:

  • Add an optional timeout parameter to ExICE.ICEAgent.get_stats/2 and pass it through to GenServer.call/3.
  • Update the get_stats typespec to include the timeout parameter.
Comments suppressed due to low confidence (1)

lib/ex_ice/ice_agent.ex:283

  • def get_stats/2 uses a default argument, so the module still exports get_stats/1 as well as get_stats/2. The current typespec only covers get_stats/2, which can cause Dialyzer/docs to treat get_stats/1 as undocumented/unknown. Consider introducing a named stats() type and adding specs for both arities; also document the new timeout parameter in the @doc since it’s now part of the public API.
  @spec get_stats(pid(), timeout()) :: %{
          bytes_sent: non_neg_integer(),
          bytes_received: non_neg_integer(),
          packets_sent: non_neg_integer(),
          packets_received: non_neg_integer(),

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@codecov

codecov Bot commented Jul 13, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.52%. Comparing base (4049deb) to head (bef65e0).

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #108      +/-   ##
==========================================
- Coverage   87.61%   87.52%   -0.10%     
==========================================
  Files          27       27              
  Lines        2140     2140              
==========================================
- Hits         1875     1873       -2     
- Misses        265      267       +2     
Files with missing lines Coverage Δ
lib/ex_ice/ice_agent.ex 72.27% <100.00%> (-1.00%) ⬇️

... and 1 file with indirect coverage changes


Continue to review full report in Codecov by Harness.

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@roznawsk
roznawsk requested a review from sgfn July 13, 2026 09:59
roznawsk added a commit to elixir-webrtc/ex_webrtc that referenced this pull request Jul 13, 2026
Uses the new timeout param from ex_ice (elixir-webrtc/ex_ice#108)
instead of calling into the ICE agent's GenServer directly.
Temporarily depends on the ex_ice branch until 0.16.1 is on hex.
@roznawsk
roznawsk merged commit 17dbe8e into master Jul 13, 2026
4 checks passed
@roznawsk
roznawsk deleted the ice-agent-get-stats-timeout branch July 13, 2026 14:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants