Skip to content

Commit c6b1860

Browse files
committed
Add more ICE stats
1 parent 606fc4c commit c6b1860

File tree

4 files changed

+19
-6
lines changed

4 files changed

+19
-6
lines changed

lib/ex_webrtc/peer_connection.ex

+14-3
Original file line numberDiff line numberDiff line change
@@ -1155,13 +1155,22 @@ defmodule ExWebRTC.PeerConnection do
11551155
type: :candidate_pair,
11561156
local_candidate_id: pair.local_cand_id,
11571157
remote_candidate_id: pair.remote_cand_id,
1158+
priority: pair.priority,
11581159
state: pair.state,
1160+
valid: pair.valid?,
1161+
last_seen: pair.last_seen,
11591162
nominated: pair.nominated?,
1160-
requests_received: pair.requests_received,
1163+
packets_sent: pair.packets_sent,
1164+
packets_received: pair.packets_received,
1165+
bytes_sent: pair.bytes_sent,
1166+
bytes_received: pair.bytes_received,
11611167
requests_sent: pair.requests_sent,
1168+
requests_received: pair.requests_received,
1169+
responses_sent: pair.responses_sent,
11621170
responses_received: pair.responses_received,
11631171
non_symmetric_responses_received: pair.non_symmetric_responses_received,
1164-
responses_sent: pair.responses_sent
1172+
packets_discarded_on_send: pair.packets_discarded_on_send,
1173+
bytes_discarded_on_send: pair.bytes_discarded_on_send
11651174
}
11661175
end
11671176

@@ -1223,7 +1232,9 @@ defmodule ExWebRTC.PeerConnection do
12231232
bytes_sent: ice_stats.bytes_sent,
12241233
bytes_received: ice_stats.bytes_received,
12251234
packets_sent: ice_stats.packets_sent,
1226-
packets_received: ice_stats.packets_received
1235+
packets_received: ice_stats.packets_received,
1236+
selected_candidate_pair_changes: ice_stats.selected_candidate_pair_changes,
1237+
unmatched_requests: ice_stats.unmatched_requests
12271238
}
12281239
}
12291240

mix.exs

+1-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ defmodule ExWebRTC.MixProject do
5757
defp deps do
5858
[
5959
{:ex_sdp, "~> 1.0"},
60-
{:ex_ice, "~> 0.11.0"},
60+
{:ex_ice, "~> 0.12.0"},
6161
{:ex_dtls, "~> 0.16.0"},
6262
{:ex_libsrtp, "~> 0.7.1"},
6363
{:ex_rtp, "~> 0.4.0"},

mix.lock

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"erlex": {:hex, :erlex, "0.2.7", "810e8725f96ab74d17aac676e748627a07bc87eb950d2b83acd29dc047a30595", [:mix], [], "hexpm", "3ed95f79d1a844c3f6bf0cea61e0d5612a42ce56da9c03f01df538685365efb0"},
1313
"ex_doc": {:hex, :ex_doc, "0.37.3", "f7816881a443cd77872b7d6118e8a55f547f49903aef8747dbcb345a75b462f9", [:mix], [{:earmark_parser, "~> 1.4.42", [hex: :earmark_parser, repo: "hexpm", optional: false]}, {:makeup_c, ">= 0.1.0", [hex: :makeup_c, repo: "hexpm", optional: true]}, {:makeup_elixir, "~> 0.14 or ~> 1.0", [hex: :makeup_elixir, repo: "hexpm", optional: false]}, {:makeup_erlang, "~> 0.1 or ~> 1.0", [hex: :makeup_erlang, repo: "hexpm", optional: false]}, {:makeup_html, ">= 0.1.0", [hex: :makeup_html, repo: "hexpm", optional: true]}], "hexpm", "e6aebca7156e7c29b5da4daa17f6361205b2ae5f26e5c7d8ca0d3f7e18972233"},
1414
"ex_dtls": {:hex, :ex_dtls, "0.16.0", "3ae38025ccc77f6db573e2e391602fa9bbc02253c137d8d2d59469a66cbe806b", [:mix], [{:bundlex, "~> 1.5.3", [hex: :bundlex, repo: "hexpm", optional: false]}, {:unifex, "~> 1.0", [hex: :unifex, repo: "hexpm", optional: false]}], "hexpm", "2a4e30d74c6ddf95cc5b796423293c06a0da295454c3823819808ff031b4b361"},
15-
"ex_ice": {:hex, :ex_ice, "0.11.0", "1315526d761ff0410ece5300e5561a8733e4ff213a9c44eb20785424a0d76d98", [:mix], [{:elixir_uuid, "~> 1.0", [hex: :elixir_uuid, repo: "hexpm", optional: false]}, {:ex_stun, "~> 0.2.0", [hex: :ex_stun, repo: "hexpm", optional: false]}, {:ex_turn, "~> 0.2.0", [hex: :ex_turn, repo: "hexpm", optional: false]}], "hexpm", "b07d7a12f98f3cd437e190ccfc7879f3787a620093c077e86e354ac085e10435"},
15+
"ex_ice": {:hex, :ex_ice, "0.12.0", "b52ec3ff878d5fb632ef9facc7657dfdf59e2ff9f23e634b0918e6ce1a05af48", [:mix], [{:elixir_uuid, "~> 1.0", [hex: :elixir_uuid, repo: "hexpm", optional: false]}, {:ex_stun, "~> 0.2.0", [hex: :ex_stun, repo: "hexpm", optional: false]}, {:ex_turn, "~> 0.2.0", [hex: :ex_turn, repo: "hexpm", optional: false]}], "hexpm", "a86024a5fbf9431082784be4bb3606d3cde9218fb325a9f208ccd6e0abfd0d73"},
1616
"ex_libsrtp": {:hex, :ex_libsrtp, "0.7.2", "211bd89c08026943ce71f3e2c0231795b99cee748808ed3ae7b97cd8d2450b6b", [:mix], [{:bunch, "~> 1.6", [hex: :bunch, repo: "hexpm", optional: false]}, {:bundlex, "~> 1.3", [hex: :bundlex, repo: "hexpm", optional: false]}, {:membrane_precompiled_dependency_provider, "~> 0.1.0", [hex: :membrane_precompiled_dependency_provider, repo: "hexpm", optional: false]}, {:unifex, "~> 1.1", [hex: :unifex, repo: "hexpm", optional: false]}], "hexpm", "2e20645d0d739a4ecdcf8d4810a0c198120c8a2f617f2b75b2e2e704d59f492a"},
1717
"ex_rtcp": {:hex, :ex_rtcp, "0.4.0", "f9e515462a9581798ff6413583a25174cfd2101c94a2ebee871cca7639886f0a", [:mix], [], "hexpm", "28956602cf210d692fcdaf3f60ca49681634e1deb28ace41246aee61ee22dc3b"},
1818
"ex_rtp": {:hex, :ex_rtp, "0.4.0", "1f1b5c1440a904706011e3afbb41741f5da309ce251cb986690ce9fd82636658", [:mix], [], "hexpm", "0f72d80d5953a62057270040f0f1ee6f955c08eeae82ac659c038001d7d5a790"},

test/ex_webrtc/peer_connection_test.exs

+3-1
Original file line numberDiff line numberDiff line change
@@ -968,7 +968,9 @@ defmodule ExWebRTC.PeerConnectionTest do
968968
bytes_sent: 0,
969969
bytes_received: 0,
970970
packets_sent: 0,
971-
packets_received: 0
971+
packets_received: 0,
972+
selected_candidate_pair_changes: 0,
973+
unmatched_requests: 0
972974
}
973975
} = stats = PeerConnection.get_stats(pc1)
974976

0 commit comments

Comments
 (0)