Correct off-by-one lost count on a restart. (#3337)
* Correct off-by-one lost count on a restart. * log sender snap shot ID * metadata cache overflow count per snapshot
This commit is contained in:
@@ -152,10 +152,11 @@ type senderSnapshot struct {
|
|||||||
maxJitterFeed float64
|
maxJitterFeed float64
|
||||||
maxJitter float64
|
maxJitter float64
|
||||||
|
|
||||||
extLastRRSN uint64
|
extLastRRSN uint64
|
||||||
intervalStats intervalStats
|
intervalStats intervalStats
|
||||||
processedReceptionReports []rtcp.ReceptionReport
|
processedReceptionReports []rtcp.ReceptionReport
|
||||||
skippedReceptionReports []rtcp.ReceptionReport
|
skippedReceptionReports []rtcp.ReceptionReport
|
||||||
|
metadataCacheOverflowCount int
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *senderSnapshot) MarshalLogObject(e zapcore.ObjectEncoder) error {
|
func (s *senderSnapshot) MarshalLogObject(e zapcore.ObjectEncoder) error {
|
||||||
@@ -188,6 +189,7 @@ func (s *senderSnapshot) MarshalLogObject(e zapcore.ObjectEncoder) error {
|
|||||||
e.AddObject("intervalStats", &s.intervalStats)
|
e.AddObject("intervalStats", &s.intervalStats)
|
||||||
e.AddObject("processedReceptionReports", wrappedReceptionReportsLogger{s, false})
|
e.AddObject("processedReceptionReports", wrappedReceptionReportsLogger{s, false})
|
||||||
e.AddObject("skippedReceptionReports", wrappedReceptionReportsLogger{s, true})
|
e.AddObject("skippedReceptionReports", wrappedReceptionReportsLogger{s, true})
|
||||||
|
e.AddInt("metadataCacheOverflowCount", s.metadataCacheOverflowCount)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -228,11 +230,10 @@ type RTPStatsSender struct {
|
|||||||
nextSenderSnapshotID uint32
|
nextSenderSnapshotID uint32
|
||||||
senderSnapshots []senderSnapshot
|
senderSnapshots []senderSnapshot
|
||||||
|
|
||||||
clockSkewCount int
|
clockSkewCount int
|
||||||
metadataCacheOverflowCount int
|
largeJumpNegativeCount int
|
||||||
largeJumpNegativeCount int
|
largeJumpCount int
|
||||||
largeJumpCount int
|
timeReversedCount int
|
||||||
timeReversedCount int
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewRTPStatsSender(params RTPStatsParams, cacheSize int) *RTPStatsSender {
|
func NewRTPStatsSender(params RTPStatsParams, cacheSize int) *RTPStatsSender {
|
||||||
@@ -370,7 +371,8 @@ func (r *RTPStatsSender) Update(
|
|||||||
"gapSN", gapSN,
|
"gapSN", gapSN,
|
||||||
"currTS", extTimestamp,
|
"currTS", extTimestamp,
|
||||||
"gapTS", int64(extTimestamp-r.extHighestTS),
|
"gapTS", int64(extTimestamp-r.extHighestTS),
|
||||||
"packetTime", packetTime,
|
"packetTime", time.Unix(0, packetTime),
|
||||||
|
"timeSinceHighest", time.Duration(packetTime-r.highestTime),
|
||||||
"marker", marker,
|
"marker", marker,
|
||||||
"hdrSize", hdrSize,
|
"hdrSize", hdrSize,
|
||||||
"payloadSize", payloadSize,
|
"payloadSize", payloadSize,
|
||||||
@@ -385,7 +387,7 @@ func (r *RTPStatsSender) Update(
|
|||||||
}
|
}
|
||||||
|
|
||||||
if extSequenceNumber < r.extStartSN {
|
if extSequenceNumber < r.extStartSN {
|
||||||
r.packetsLost += r.extStartSN - extSequenceNumber
|
r.packetsLost += r.extStartSN - extSequenceNumber - 1
|
||||||
|
|
||||||
// adjust start of snapshots
|
// adjust start of snapshots
|
||||||
for i := uint32(0); i < r.nextSnapshotID-cFirstSnapshotID; i++ {
|
for i := uint32(0); i < r.nextSnapshotID-cFirstSnapshotID; i++ {
|
||||||
@@ -635,17 +637,18 @@ func (r *RTPStatsSender) UpdateFromReceiverReport(rr rtcp.ReceptionReport) (rtt
|
|||||||
if r.lastRRTime == 0 {
|
if r.lastRRTime == 0 {
|
||||||
timeSinceLastRR = time.Duration(mono.UnixNano() - r.startTime)
|
timeSinceLastRR = time.Duration(mono.UnixNano() - r.startTime)
|
||||||
}
|
}
|
||||||
r.metadataCacheOverflowCount++
|
s.metadataCacheOverflowCount++
|
||||||
if (r.metadataCacheOverflowCount-1)%10 == 0 {
|
if (s.metadataCacheOverflowCount-1)%10 == 0 {
|
||||||
r.logger.Infow(
|
r.logger.Infow(
|
||||||
"metadata cache overflow",
|
"metadata cache overflow",
|
||||||
|
"senderSnapshotID", i+cFirstSnapshotID,
|
||||||
"timeSinceLastRR", timeSinceLastRR,
|
"timeSinceLastRR", timeSinceLastRR,
|
||||||
"receivedRR", rr,
|
"receivedRR", rr,
|
||||||
"extReceivedRRSN", extReceivedRRSN,
|
"extReceivedRRSN", extReceivedRRSN,
|
||||||
"packetsInInterval", extReceivedRRSN-s.extLastRRSN,
|
"packetsInInterval", extReceivedRRSN-s.extLastRRSN,
|
||||||
"intervalStats", &is,
|
"intervalStats", &is,
|
||||||
"aggregateIntervalStats", eis,
|
"aggregateIntervalStats", eis,
|
||||||
"count", r.metadataCacheOverflowCount,
|
"count", s.metadataCacheOverflowCount,
|
||||||
"rtpStats", lockedRTPStatsSenderLogEncoder{r},
|
"rtpStats", lockedRTPStatsSenderLogEncoder{r},
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user