Increase frequency of status updates and longer availability threshold (#628)

* Increase frequency of status updates and longer avail. threshold.

* better fix.

* fix room close test failure due to slow peer connection Close

* Perform avg computation more frequently if data has changed
This commit is contained in:
David Zhao
2022-04-19 22:18:00 -07:00
committed by GitHub
parent 7a60278f64
commit 282e2aed49
6 changed files with 57 additions and 34 deletions
+2 -3
View File
@@ -4,14 +4,13 @@ import (
"context"
"time"
"github.com/livekit/livekit-server/pkg/config"
"github.com/livekit/livekit-server/pkg/utils"
"github.com/livekit/protocol/livekit"
"github.com/livekit/protocol/logger"
"github.com/livekit/protocol/webhook"
)
const updateFrequency = time.Second * 10
//go:generate go run github.com/maxbrunsfeld/counterfeiter/v6 . TelemetryService
type TelemetryService interface {
// stats
@@ -57,7 +56,7 @@ func NewTelemetryService(notifier webhook.Notifier, analytics AnalyticsService)
}
func (t *telemetryService) run() {
ticker := time.NewTicker(updateFrequency)
ticker := time.NewTicker(config.StatsUpdateFrequency)
defer ticker.Stop()
for {
<-ticker.C