Code inspection (#581)

* Code inspection

* fix [4]int64 conversiong
This commit is contained in:
David Colburn
2022-03-30 13:49:53 -07:00
committed by GitHub
parent 26f7bb498a
commit 0b8a180554
77 changed files with 228 additions and 151 deletions
+5 -3
View File
@@ -4,9 +4,11 @@ import (
"context"
"github.com/gammazero/workerpool"
"github.com/livekit/livekit-server/pkg/telemetry/prometheus"
"github.com/livekit/protocol/livekit"
"github.com/livekit/protocol/webhook"
"github.com/livekit/livekit-server/pkg/telemetry/prometheus"
)
const maxWebhookWorkers = 50
@@ -75,8 +77,8 @@ func (t *telemetryServiceInternal) Report(ctx context.Context, stats []*livekit.
totalPackets := uint32(0)
totalBytes := uint64(0)
for _, stream := range stat.Streams {
totalPackets += (stream.TotalPrimaryPackets + stream.TotalRetransmitPackets + stream.TotalPaddingPackets)
totalBytes += (stream.TotalPrimaryBytes + stream.TotalRetransmitBytes + stream.TotalPaddingBytes)
totalPackets += stream.TotalPrimaryPackets + stream.TotalRetransmitPackets + stream.TotalPaddingPackets
totalBytes += stream.TotalPrimaryBytes + stream.TotalRetransmitBytes + stream.TotalPaddingBytes
}
prometheus.IncrementPackets(direction, uint64(totalPackets))
prometheus.IncrementBytes(direction, totalBytes)