Open danjenkins opened 3 months ago
Looking into this a bit more...
If I go get the stats and loop through them...
stats := pc.GetStats()
for _, report := range stats {
if candidatePairStats, ok := report.(webrtc.ICECandidatePairStats); ok {
// Check if this candidate pair is the selected one
// if candidatePairStats.Nominated {
fmt.Printf("Candidate Pair %+v\n", candidatePairStats)
// }
}
}
I end up with stats that don't change... and have no BytesSent/Received etc.
Candidate Pair {Timestamp:1.723193118292e+12 Type:candidate-pair ID:candidate:8P1w36kyIljTeMqueMkM6hdTTDTDdAl8-candidate:utpvQgEY0b4+QBQIb+mLNYNNCHDK1aV6 TransportID: LocalCandidateID:candidate:8P1w36kyIljTeMqueMkM6hdTTDTDdAl8 RemoteCandidateID:candidate:utpvQgEY0b4+QBQIb+mLNYNNCHDK1aV6 State:succeeded Nominated:true PacketsSent:0 PacketsReceived:0 BytesSent:0 BytesReceived:0 LastPacketSentTimestamp:-6.795364578871e+12 LastPacketReceivedTimestamp:-6.795364578871e+12 FirstRequestTimestamp:-6.795364578871e+12 LastRequestTimestamp:-6.795364578871e+12 LastResponseTimestamp:-6.795364578871e+12 TotalRoundTripTime:0 CurrentRoundTripTime:0 AvailableOutgoingBitrate:0 AvailableIncomingBitrate:0 CircuitBreakerTriggerCount:0 RequestsReceived:0 RequestsSent:0 ResponsesReceived:0 ResponsesSent:0 RetransmissionsReceived:0 RetransmissionsSent:0 ConsentRequestsSent:0 ConsentExpiredTimestamp:-6.795364578871e+12}
Are CandidatePairStats even implemented properly?
Nope they're not...
https://github.com/pion/ice/blob/master/agent_stats.go#L23-L44
Your environment.
What did you do?
go and grab the candidate pair from the SCTP transport. use that candidate pair to get stats on it
What did you expect?
an ok result and some stats
What happened?
a non ok response and no stats
when you print out what c.statsID is from a candidate pair gathered from
pc.SCTP().Transport().ICETransport().GetSelectedCandidatePair()
you get no statsIDusing this blank statsID results in obviously no data retrieved from the stats report.
However... even if I go and remake the candidate pair stats ID I still get no results...
Something isn't right... I know its in the StatsReport
Other than adding some debugging to stats_go.go I haven't gone much further with this yet.
theres two issues here.... the statsID in a candidatePair doesn't seem to get stored properly. When you do have a statsID you still can't retrieve the stat