clean up redundant String calls in logs (#3064)
This commit is contained in:
@@ -1740,9 +1740,9 @@ func (f *Forwarder) processSourceSwitch(extPkt *buffer.ExtPacket, layer int32) e
|
|||||||
extRefTS = extExpectedTS
|
extRefTS = extExpectedTS
|
||||||
f.logger.Infow(
|
f.logger.Infow(
|
||||||
"calculating dummyStartTSOffset",
|
"calculating dummyStartTSOffset",
|
||||||
"preStartTime", f.preStartTime.String(),
|
"preStartTime", f.preStartTime,
|
||||||
"extFirstTS", f.extFirstTS,
|
"extFirstTS", f.extFirstTS,
|
||||||
"timeSinceFirst", timeSinceFirst.String(),
|
"timeSinceFirst", timeSinceFirst,
|
||||||
"rtpDiff", rtpDiff,
|
"rtpDiff", rtpDiff,
|
||||||
"extRefTS", extRefTS,
|
"extRefTS", extRefTS,
|
||||||
"incomingTS", extPkt.Packet.Timestamp,
|
"incomingTS", extPkt.Packet.Timestamp,
|
||||||
@@ -1831,7 +1831,7 @@ func (f *Forwarder) processSourceSwitch(extPkt *buffer.ExtPacket, layer int32) e
|
|||||||
if bigJump { // TODO-REMOVE-AFTER-DATA-COLLECTION
|
if bigJump { // TODO-REMOVE-AFTER-DATA-COLLECTION
|
||||||
f.logger.Infow(
|
f.logger.Infow(
|
||||||
"next timestamp on switch",
|
"next timestamp on switch",
|
||||||
"switchingAt", switchingAt.String(),
|
"switchingAt", switchingAt,
|
||||||
"layer", layer,
|
"layer", layer,
|
||||||
"extLastTS", extLastTS,
|
"extLastTS", extLastTS,
|
||||||
"lastMarker", rtpMungerState.LastMarker,
|
"lastMarker", rtpMungerState.LastMarker,
|
||||||
@@ -1849,7 +1849,7 @@ func (f *Forwarder) processSourceSwitch(extPkt *buffer.ExtPacket, layer int32) e
|
|||||||
} else {
|
} else {
|
||||||
f.logger.Debugw(
|
f.logger.Debugw(
|
||||||
"next timestamp on switch",
|
"next timestamp on switch",
|
||||||
"switchingAt", switchingAt.String(),
|
"switchingAt", switchingAt,
|
||||||
"layer", layer,
|
"layer", layer,
|
||||||
"extLastTS", extLastTS,
|
"extLastTS", extLastTS,
|
||||||
"lastMarker", rtpMungerState.LastMarker,
|
"lastMarker", rtpMungerState.LastMarker,
|
||||||
|
|||||||
@@ -529,17 +529,17 @@ func (r *rtpStatsBase) maybeAdjustFirstPacketTime(srData *livekit.RTCPSenderRepo
|
|||||||
|
|
||||||
getFields := func() []interface{} {
|
getFields := func() []interface{} {
|
||||||
return []interface{}{
|
return []interface{}{
|
||||||
"startTime", r.startTime.String(),
|
"startTime", r.startTime,
|
||||||
"nowTime", time.Unix(0, now).String(),
|
"nowTime", time.Unix(0, now),
|
||||||
"before", time.Unix(0, r.firstTime).String(),
|
"before", time.Unix(0, r.firstTime),
|
||||||
"after", time.Unix(0, firstTime).String(),
|
"after", time.Unix(0, firstTime),
|
||||||
"adjustment", time.Duration(r.firstTime - firstTime).String(),
|
"adjustment", time.Duration(r.firstTime - firstTime),
|
||||||
"extNowTS", extNowTS,
|
"extNowTS", extNowTS,
|
||||||
"extStartTS", extStartTS,
|
"extStartTS", extStartTS,
|
||||||
"srData", WrappedRTCPSenderReportStateLogger{srData},
|
"srData", WrappedRTCPSenderReportStateLogger{srData},
|
||||||
"tsOffset", tsOffset,
|
"tsOffset", tsOffset,
|
||||||
"timeSinceReceive", timeSinceReceive.String(),
|
"timeSinceReceive", timeSinceReceive,
|
||||||
"timeSinceFirst", timeSinceFirst.String(),
|
"timeSinceFirst", timeSinceFirst,
|
||||||
"samplesDiff", samplesDiff,
|
"samplesDiff", samplesDiff,
|
||||||
"samplesDuration", samplesDuration,
|
"samplesDuration", samplesDuration,
|
||||||
}
|
}
|
||||||
@@ -593,7 +593,7 @@ func (r *rtpStatsBase) deltaInfo(snapshotID uint32, extStartSN uint64, extHighes
|
|||||||
"packetsExpected", packetsExpected,
|
"packetsExpected", packetsExpected,
|
||||||
"startTime", startTime,
|
"startTime", startTime,
|
||||||
"endTime", endTime,
|
"endTime", endTime,
|
||||||
"duration", endTime.Sub(startTime).String(),
|
"duration", endTime.Sub(startTime),
|
||||||
}
|
}
|
||||||
err = errors.New("too many packets expected in delta")
|
err = errors.New("too many packets expected in delta")
|
||||||
return
|
return
|
||||||
|
|||||||
@@ -160,7 +160,7 @@ func (r *RTPStatsReceiver) Update(
|
|||||||
"snRolloverCount", snRolloverCount,
|
"snRolloverCount", snRolloverCount,
|
||||||
"expectedTSJump", expectedTSJump,
|
"expectedTSJump", expectedTSJump,
|
||||||
"tsRolloverCount", tsRolloverCount,
|
"tsRolloverCount", tsRolloverCount,
|
||||||
"packetTime", time.Unix(0, packetTime).String(),
|
"packetTime", time.Unix(0, packetTime),
|
||||||
"sequenceNumber", sequenceNumber,
|
"sequenceNumber", sequenceNumber,
|
||||||
"timestamp", timestamp,
|
"timestamp", timestamp,
|
||||||
"marker", marker,
|
"marker", marker,
|
||||||
|
|||||||
@@ -83,23 +83,22 @@ func (is *intervalStats) aggregate(other *intervalStats) {
|
|||||||
is.packetsNotFound += other.packetsNotFound
|
is.packetsNotFound += other.packetsNotFound
|
||||||
}
|
}
|
||||||
|
|
||||||
func (is *intervalStats) ToString() string {
|
func (is *intervalStats) MarshalLogObject(e zapcore.ObjectEncoder) error {
|
||||||
if is == nil {
|
if is == nil {
|
||||||
return "-"
|
return nil
|
||||||
}
|
}
|
||||||
|
e.AddUint64("packets", is.packets)
|
||||||
|
e.AddUint64("bytes", is.bytes)
|
||||||
|
e.AddUint64("headerBytes", is.headerBytes)
|
||||||
|
e.AddUint64("packetsPadding", is.packetsPadding)
|
||||||
|
e.AddUint64("bytesPadding", is.bytesPadding)
|
||||||
|
e.AddUint64("headerBytesPadding", is.headerBytesPadding)
|
||||||
|
e.AddUint64("packetsLost", is.packetsLost)
|
||||||
|
e.AddUint64("packetsOutOfOrder", is.packetsOutOfOrder)
|
||||||
|
e.AddUint32("frames", is.frames)
|
||||||
|
e.AddUint64("packetsNotFound", is.packetsNotFound)
|
||||||
|
|
||||||
return fmt.Sprintf("p: %d, b: %d, hb: %d, pp: %d, bp: %d, hbp: %d, pl: %d, pooo: %d, f: %d, pnf: %d",
|
return nil
|
||||||
is.packets,
|
|
||||||
is.bytes,
|
|
||||||
is.headerBytes,
|
|
||||||
is.packetsPadding,
|
|
||||||
is.bytesPadding,
|
|
||||||
is.headerBytesPadding,
|
|
||||||
is.packetsLost,
|
|
||||||
is.packetsOutOfOrder,
|
|
||||||
is.frames,
|
|
||||||
is.packetsNotFound,
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
@@ -467,7 +466,7 @@ func (r *RTPStatsSender) UpdateFromReceiverReport(rr rtcp.ReceptionReport) (rtt
|
|||||||
if !r.lastRRTime.IsZero() && r.extHighestSNFromRR > extHighestSNFromRR {
|
if !r.lastRRTime.IsZero() && r.extHighestSNFromRR > extHighestSNFromRR {
|
||||||
r.logger.Debugw(
|
r.logger.Debugw(
|
||||||
fmt.Sprintf("receiver report potentially out of order, highestSN: existing: %d, received: %d", r.extHighestSNFromRR, extHighestSNFromRR),
|
fmt.Sprintf("receiver report potentially out of order, highestSN: existing: %d, received: %d", r.extHighestSNFromRR, extHighestSNFromRR),
|
||||||
"sinceLastRR", time.Since(r.lastRRTime).String(),
|
"sinceLastRR", time.Since(r.lastRRTime),
|
||||||
"receivedRR", rr,
|
"receivedRR", rr,
|
||||||
"rtpStats", lockedRTPStatsSenderLogEncoder{r},
|
"rtpStats", lockedRTPStatsSenderLogEncoder{r},
|
||||||
)
|
)
|
||||||
@@ -531,7 +530,7 @@ func (r *RTPStatsSender) UpdateFromReceiverReport(rr rtcp.ReceptionReport) (rtt
|
|||||||
}
|
}
|
||||||
r.logger.Infow(
|
r.logger.Infow(
|
||||||
"rr interval too big, skipping",
|
"rr interval too big, skipping",
|
||||||
"timeSinceLastRR", timeSinceLastRR.String(),
|
"timeSinceLastRR", timeSinceLastRR,
|
||||||
"receivedRR", rr,
|
"receivedRR", rr,
|
||||||
"extReceivedRRSN", extReceivedRRSN,
|
"extReceivedRRSN", extReceivedRRSN,
|
||||||
"packetsInInterval", extReceivedRRSN-s.extLastRRSN,
|
"packetsInInterval", extReceivedRRSN-s.extLastRRSN,
|
||||||
@@ -553,12 +552,12 @@ func (r *RTPStatsSender) UpdateFromReceiverReport(rr rtcp.ReceptionReport) (rtt
|
|||||||
if (r.metadataCacheOverflowCount-1)%10 == 0 {
|
if (r.metadataCacheOverflowCount-1)%10 == 0 {
|
||||||
r.logger.Infow(
|
r.logger.Infow(
|
||||||
"metadata cache overflow",
|
"metadata cache overflow",
|
||||||
"timeSinceLastRR", timeSinceLastRR.String(),
|
"timeSinceLastRR", timeSinceLastRR,
|
||||||
"receivedRR", rr,
|
"receivedRR", rr,
|
||||||
"extReceivedRRSN", extReceivedRRSN,
|
"extReceivedRRSN", extReceivedRRSN,
|
||||||
"packetsInInterval", extReceivedRRSN-s.extLastRRSN,
|
"packetsInInterval", extReceivedRRSN-s.extLastRRSN,
|
||||||
"intervalStats", is.ToString(),
|
"intervalStats", &is,
|
||||||
"aggregateIntervalStats", eis.ToString(),
|
"aggregateIntervalStats", eis,
|
||||||
"count", r.metadataCacheOverflowCount,
|
"count", r.metadataCacheOverflowCount,
|
||||||
"rtpStats", lockedRTPStatsSenderLogEncoder{r},
|
"rtpStats", lockedRTPStatsSenderLogEncoder{r},
|
||||||
)
|
)
|
||||||
@@ -645,12 +644,12 @@ func (r *RTPStatsSender) GetRtcpSenderReport(ssrc uint32, publisherSRData *livek
|
|||||||
"curr", WrappedRTCPSenderReportStateLogger{srData},
|
"curr", WrappedRTCPSenderReportStateLogger{srData},
|
||||||
"feed", WrappedRTCPSenderReportStateLogger{publisherSRData},
|
"feed", WrappedRTCPSenderReportStateLogger{publisherSRData},
|
||||||
"tsOffset", tsOffset,
|
"tsOffset", tsOffset,
|
||||||
"timeNow", time.Now().String(),
|
"timeNow", time.Now(),
|
||||||
"now", time.Unix(0, now).String(),
|
"now", time.Unix(0, now),
|
||||||
"timeSinceHighest", time.Unix(0, now).Sub(time.Unix(0, r.highestTime)).String(),
|
"timeSinceHighest", time.Duration(now-r.highestTime),
|
||||||
"timeSinceFirst", time.Unix(0, now).Sub(time.Unix(0, r.firstTime)).String(),
|
"timeSinceFirst", time.Duration(now-r.firstTime),
|
||||||
"timeSincePublisherSRAdjusted", timeSincePublisherSRAdjusted.String(),
|
"timeSincePublisherSRAdjusted", timeSincePublisherSRAdjusted,
|
||||||
"timeSincePublisherSR", time.Since(time.Unix(0, publisherSRData.At)).String(),
|
"timeSincePublisherSR", time.Since(time.Unix(0, publisherSRData.At)),
|
||||||
"nowRTPExt", nowRTPExt,
|
"nowRTPExt", nowRTPExt,
|
||||||
"rtpStats", lockedRTPStatsSenderLogEncoder{r},
|
"rtpStats", lockedRTPStatsSenderLogEncoder{r},
|
||||||
)
|
)
|
||||||
@@ -664,7 +663,7 @@ func (r *RTPStatsSender) GetRtcpSenderReport(ssrc uint32, publisherSRData *livek
|
|||||||
if (r.clockSkewCount-1)%100 == 0 {
|
if (r.clockSkewCount-1)%100 == 0 {
|
||||||
logger.Infow(
|
logger.Infow(
|
||||||
"sending sender report, clock skew",
|
"sending sender report, clock skew",
|
||||||
"timeSinceLastReport", timeSinceLastReport.String(),
|
"timeSinceLastReport", timeSinceLastReport,
|
||||||
"rtpDiffSinceLastReport", rtpDiffSinceLastReport,
|
"rtpDiffSinceLastReport", rtpDiffSinceLastReport,
|
||||||
"windowClockRate", windowClockRate,
|
"windowClockRate", windowClockRate,
|
||||||
"count", r.clockSkewCount,
|
"count", r.clockSkewCount,
|
||||||
@@ -732,9 +731,9 @@ func (r *RTPStatsSender) DeltaInfoSender(senderSnapshotID uint32) *RTPDeltaInfo
|
|||||||
"startSN", then.extStartSN,
|
"startSN", then.extStartSN,
|
||||||
"endSN", now.extStartSN,
|
"endSN", now.extStartSN,
|
||||||
"packetsExpected", packetsExpected,
|
"packetsExpected", packetsExpected,
|
||||||
"startTime", startTime.String(),
|
"startTime", startTime,
|
||||||
"endTime", endTime.String(),
|
"endTime", endTime,
|
||||||
"duration", endTime.Sub(startTime).String(),
|
"duration", endTime.Sub(startTime),
|
||||||
"rtpStats", lockedRTPStatsSenderLogEncoder{r},
|
"rtpStats", lockedRTPStatsSenderLogEncoder{r},
|
||||||
)
|
)
|
||||||
return nil
|
return nil
|
||||||
|
|||||||
Reference in New Issue
Block a user