Use a worker to report signal/data stats. (#2260)
* Use a worker to report signal/data stats. Was checking if reporting is needed on every update. The check is wasted work if volume of signal/data messages is high as reporting happens only once in 10 seconds. Changing to a worker based on a timer. And also aligning with telemetry reporting interval which defaults to 30 seconds. * Remove unused constant
This commit is contained in:
@@ -126,8 +126,6 @@ func (s *StatsWorker) ClosedAt() time.Time {
|
||||
return s.closedAt
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
|
||||
func (s *StatsWorker) collectStats(
|
||||
ts *timestamppb.Timestamp,
|
||||
streamType livekit.StreamType,
|
||||
@@ -151,6 +149,8 @@ func (s *StatsWorker) collectStats(
|
||||
return stats
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
|
||||
// create a single stream and single video layer post aggregation
|
||||
func coalesce(stats []*livekit.AnalyticsStat) *livekit.AnalyticsStat {
|
||||
if len(stats) == 0 {
|
||||
|
||||
Reference in New Issue
Block a user