Rename StatsUpdateFrequency -> StatsUpdateInterval

This commit is contained in:
David Zhao
2022-04-19 22:22:58 -07:00
parent 8535f3d5b9
commit 431069af95
3 changed files with 3 additions and 3 deletions

View File

@@ -23,7 +23,7 @@ const (
CongestionControlProbeModePadding CongestionControlProbeMode = "padding"
CongestionControlProbeModeMedia CongestionControlProbeMode = "media"
StatsUpdateFrequency = time.Second * 10
StatsUpdateInterval = time.Second * 10
)
type Config struct {

View File

@@ -69,7 +69,7 @@ func GetUpdatedNodeStats(prev *livekit.NodeStats, prevAverage *livekit.NodeStats
updatedAt := time.Now().Unix()
elapsed := updatedAt - prevAverage.UpdatedAt
// include sufficient buffer to be sure a stats update had taken place
computeAverage := elapsed > int64(config.StatsUpdateFrequency.Seconds()+2)
computeAverage := elapsed > int64(config.StatsUpdateInterval.Seconds()+2)
if bytesInNow != prevAverage.BytesIn ||
bytesOutNow != prevAverage.BytesOut ||
packetsInNow != prevAverage.PacketsIn ||

View File

@@ -56,7 +56,7 @@ func NewTelemetryService(notifier webhook.Notifier, analytics AnalyticsService)
}
func (t *telemetryService) run() {
ticker := time.NewTicker(config.StatsUpdateFrequency)
ticker := time.NewTicker(config.StatsUpdateInterval)
defer ticker.Stop()
for {
<-ticker.C