Imlement analytics per track statistics (#281)

New tests for telemetry + implementation of per track statistics
This commit is contained in:
Artur Shellunts
2021-12-29 19:29:24 +01:00
committed by GitHub
parent 9d78619ca3
commit 828d490755
10 changed files with 559 additions and 154 deletions
+7
View File
@@ -618,6 +618,13 @@ func (b *Buffer) GetStats() (stats Stats) {
return
}
// Used only in tests
func (b *Buffer) SetStatsTestOnly(stats Stats) {
b.Lock()
b.stats = stats
b.Unlock()
}
// GetLatestTimestamp returns the latest RTP timestamp factoring in potential RTP timestamp wrap-around
func (b *Buffer) GetLatestTimestamp() (latestTimestamp uint32, latestTimestampTimeInNanosSinceEpoch int64) {
latestTimestamp = atomic.LoadUint32(&b.latestTimestamp)