Tighten up publish latency stat. (#4615)
Previously it was anchored to participant transitioning to `ACTIVE` if the add track request happened before that. But, that has a few issues 1.`ACTIVE` is for primary peer connection which could be subscriber peer connection. 2. `ACTIVE` also include data channel establishment. Switch to first connected time of publisher peer connection for that to get a more accurate measure of track publish time.
This commit is contained in:
@@ -227,6 +227,10 @@ func (t *TransportManager) HasPublisherEverConnected() bool {
|
||||
return t.publisher.HasEverConnected()
|
||||
}
|
||||
|
||||
func (t *TransportManager) PublisherFirstConnectedAt() time.Time {
|
||||
return t.publisher.FirstConnectedAt()
|
||||
}
|
||||
|
||||
func (t *TransportManager) IsPublisherEstablished() bool {
|
||||
return t.publisher.IsEstablished()
|
||||
}
|
||||
@@ -267,6 +271,14 @@ func (t *TransportManager) HasSubscriberEverConnected() bool {
|
||||
}
|
||||
}
|
||||
|
||||
func (t *TransportManager) SubscriberFirstConnectedAt() time.Time {
|
||||
if t.params.UseOneShotSignallingMode || t.params.UseSinglePeerConnection {
|
||||
return t.publisher.FirstConnectedAt()
|
||||
} else {
|
||||
return t.subscriber.FirstConnectedAt()
|
||||
}
|
||||
}
|
||||
|
||||
func (t *TransportManager) AddTrackLocal(
|
||||
trackLocal webrtc.TrackLocal,
|
||||
params types.AddTrackParams,
|
||||
|
||||
Reference in New Issue
Block a user