Documentation
¶
Index ¶
- func BytesTrackIDForParticipantID(typ BytesTrackType, participantID livekit.ParticipantID) livekit.TrackID
- type AnalyticsService
- type BytesSignalStats
- type BytesTrackStats
- type BytesTrackType
- type CondensedStat
- type Conn
- type Listener
- type PacketConn
- type ReferenceCount
- type ReferenceGuard
- type RelayAddressGenerator
- type StatsKey
- type StatsWorker
- func (s *StatsWorker) Close(guard *ReferenceGuard) bool
- func (s *StatsWorker) Closed(guard *ReferenceGuard) bool
- func (s *StatsWorker) Flush(now time.Time) bool
- func (s *StatsWorker) IsConnected() bool
- func (s *StatsWorker) OnTrackStat(trackID livekit.TrackID, direction livekit.StreamType, ...)
- func (s *StatsWorker) ParticipantID() livekit.ParticipantID
- func (s *StatsWorker) SetConnected()
- type TelemetryService
- type TrafficTotals
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BytesTrackIDForParticipantID ¶ added in v1.3.2
func BytesTrackIDForParticipantID(typ BytesTrackType, participantID livekit.ParticipantID) livekit.TrackID
Types ¶
type AnalyticsService ¶ added in v0.15.0
type AnalyticsService interface {
SendStats(ctx context.Context, stats []*livekit.AnalyticsStat)
SendEvent(ctx context.Context, events *livekit.AnalyticsEvent)
SendNodeRoomStates(ctx context.Context, nodeRooms *livekit.AnalyticsNodeRooms)
RoomProjectReporter(ctx context.Context) roomobs.ProjectReporter
}
func NewAnalyticsService ¶ added in v0.15.0
func NewAnalyticsService(_ *config.Config, currentNode routing.LocalNode) AnalyticsService
type BytesSignalStats ¶ added in v1.6.0
type BytesSignalStats struct {
BytesTrackStats
// contains filtered or unexported fields
}
func NewBytesSignalStats ¶ added in v1.6.0
func NewBytesSignalStats( ctx context.Context, telemetry TelemetryService, ) *BytesSignalStats
func (*BytesSignalStats) Reset ¶ added in v1.9.1
func (s *BytesSignalStats) Reset()
func (*BytesSignalStats) ResolveParticipant ¶ added in v1.6.0
func (s *BytesSignalStats) ResolveParticipant(pi *livekit.ParticipantInfo)
func (*BytesSignalStats) ResolveRoom ¶ added in v1.6.0
func (s *BytesSignalStats) ResolveRoom(ri *livekit.Room)
type BytesTrackStats ¶ added in v1.3.2
type BytesTrackStats struct {
// contains filtered or unexported fields
}
stats for signal and data channel
func NewBytesTrackStats ¶ added in v1.3.2
func NewBytesTrackStats( country string, trackID livekit.TrackID, pID livekit.ParticipantID, telemetry TelemetryService, participantReporter roomobs.ParticipantSessionReporter, ) *BytesTrackStats
func (*BytesTrackStats) AddBytes ¶ added in v1.3.2
func (s *BytesTrackStats) AddBytes(bytes uint64, isSend bool)
func (*BytesTrackStats) GetTrafficTotals ¶ added in v1.5.2
func (s *BytesTrackStats) GetTrafficTotals() *TrafficTotals
func (*BytesTrackStats) Stop ¶ added in v1.5.2
func (s *BytesTrackStats) Stop()
type BytesTrackType ¶ added in v1.3.2
type BytesTrackType string
const ( BytesTrackTypeData BytesTrackType = "DT" BytesTrackTypeSignal BytesTrackType = "SG" )
type CondensedStat ¶ added in v1.9.1
type CondensedStat struct {
StartTime time.Time
EndTime time.Time
Bytes uint64
Packets uint32
PacketsLost uint32
Frames uint32
}
func CondenseStat ¶ added in v1.9.1
func CondenseStat(stat *livekit.AnalyticsStat) (ps CondensedStat, ok bool)
type Listener ¶ added in v1.2.1
func NewListener ¶ added in v1.2.1
type PacketConn ¶ added in v1.2.1
type PacketConn struct {
net.PacketConn
// contains filtered or unexported fields
}
func NewPacketConn ¶ added in v1.2.1
func NewPacketConn(c net.PacketConn, direction prometheus.Direction) *PacketConn
func (*PacketConn) Close ¶ added in v1.2.1
func (c *PacketConn) Close() error
type ReferenceCount ¶ added in v1.9.2
type ReferenceCount struct {
// contains filtered or unexported fields
}
func (*ReferenceCount) Activate ¶ added in v1.9.2
func (s *ReferenceCount) Activate(guard *ReferenceGuard)
func (*ReferenceCount) Release ¶ added in v1.9.2
func (s *ReferenceCount) Release(guard *ReferenceGuard) bool
type ReferenceGuard ¶ added in v1.9.2
type ReferenceGuard struct {
// contains filtered or unexported fields
}
type RelayAddressGenerator ¶ added in v1.2.1
type RelayAddressGenerator struct {
turn.RelayAddressGenerator
}
func NewRelayAddressGenerator ¶ added in v1.2.1
func NewRelayAddressGenerator(g turn.RelayAddressGenerator) *RelayAddressGenerator
func (*RelayAddressGenerator) AllocateConn ¶ added in v1.2.1
func (*RelayAddressGenerator) AllocatePacketConn ¶ added in v1.2.1
func (g *RelayAddressGenerator) AllocatePacketConn(network string, requestedPort int) (net.PacketConn, net.Addr, error)
type StatsKey ¶ added in v1.3.4
type StatsKey struct {
// contains filtered or unexported fields
}
func StatsKeyForData ¶ added in v1.3.4
func StatsKeyForData( country string, streamType livekit.StreamType, participantID livekit.ParticipantID, trackID livekit.TrackID, ) StatsKey
func StatsKeyForTrack ¶ added in v1.3.4
func StatsKeyForTrack( country string, streamType livekit.StreamType, participantID livekit.ParticipantID, trackID livekit.TrackID, trackSource livekit.TrackSource, trackType livekit.TrackType, ) StatsKey
type StatsWorker ¶
type StatsWorker struct {
// contains filtered or unexported fields
}
StatsWorker handles participant stats
func (*StatsWorker) Close ¶
func (s *StatsWorker) Close(guard *ReferenceGuard) bool
func (*StatsWorker) Closed ¶ added in v1.7.1
func (s *StatsWorker) Closed(guard *ReferenceGuard) bool
func (*StatsWorker) IsConnected ¶ added in v1.3.3
func (s *StatsWorker) IsConnected() bool
func (*StatsWorker) OnTrackStat ¶ added in v0.15.3
func (s *StatsWorker) OnTrackStat(trackID livekit.TrackID, direction livekit.StreamType, stat *livekit.AnalyticsStat)
func (*StatsWorker) ParticipantID ¶ added in v1.2.0
func (s *StatsWorker) ParticipantID() livekit.ParticipantID
func (*StatsWorker) SetConnected ¶ added in v1.3.3
func (s *StatsWorker) SetConnected()
type TelemetryService ¶
type TelemetryService interface {
// TrackStats is called periodically for each track in both directions (published/subscribed)
TrackStats(key StatsKey, stat *livekit.AnalyticsStat)
// events
RoomStarted(ctx context.Context, room *livekit.Room)
RoomEnded(ctx context.Context, room *livekit.Room)
// ParticipantJoined - a participant establishes signal connection to a room
ParticipantJoined(ctx context.Context, room *livekit.Room, participant *livekit.ParticipantInfo, clientInfo *livekit.ClientInfo, clientMeta *livekit.AnalyticsClientMeta, shouldSendEvent bool, guard *ReferenceGuard)
// ParticipantActive - a participant establishes media connection
ParticipantActive(ctx context.Context, room *livekit.Room, participant *livekit.ParticipantInfo, clientMeta *livekit.AnalyticsClientMeta, isMigration bool, guard *ReferenceGuard)
// ParticipantResumed - there has been an ICE restart or connection resume attempt, and we've received their signal connection
ParticipantResumed(ctx context.Context, room *livekit.Room, participant *livekit.ParticipantInfo, nodeID livekit.NodeID, reason livekit.ReconnectReason)
// ParticipantLeft - the participant leaves the room, only sent if ParticipantActive has been called before
ParticipantLeft(ctx context.Context, room *livekit.Room, participant *livekit.ParticipantInfo, shouldSendEvent bool, guard *ReferenceGuard)
// TrackPublishRequested - a publication attempt has been received
TrackPublishRequested(ctx context.Context, participantID livekit.ParticipantID, identity livekit.ParticipantIdentity, track *livekit.TrackInfo)
// TrackPublished - a publication attempt has been successful
TrackPublished(ctx context.Context, participantID livekit.ParticipantID, identity livekit.ParticipantIdentity, track *livekit.TrackInfo)
// TrackUnpublished - a participant unpublished a track
TrackUnpublished(ctx context.Context, participantID livekit.ParticipantID, identity livekit.ParticipantIdentity, track *livekit.TrackInfo, shouldSendEvent bool)
// TrackSubscribeRequested - a participant requested to subscribe to a track
TrackSubscribeRequested(ctx context.Context, participantID livekit.ParticipantID, track *livekit.TrackInfo)
// TrackSubscribed - a participant subscribed to a track successfully
TrackSubscribed(ctx context.Context, participantID livekit.ParticipantID, track *livekit.TrackInfo, publisher *livekit.ParticipantInfo, shouldSendEvent bool)
// TrackUnsubscribed - a participant unsubscribed from a track successfully
TrackUnsubscribed(ctx context.Context, participantID livekit.ParticipantID, track *livekit.TrackInfo, shouldSendEvent bool)
// TrackSubscribeFailed - failure to subscribe to a track
TrackSubscribeFailed(ctx context.Context, participantID livekit.ParticipantID, trackID livekit.TrackID, err error, isUserError bool)
// TrackMuted - the publisher has muted the Track
TrackMuted(ctx context.Context, participantID livekit.ParticipantID, track *livekit.TrackInfo)
// TrackUnmuted - the publisher has muted the Track
TrackUnmuted(ctx context.Context, participantID livekit.ParticipantID, track *livekit.TrackInfo)
// TrackPublishedUpdate - track metadata has been updated
TrackPublishedUpdate(ctx context.Context, participantID livekit.ParticipantID, track *livekit.TrackInfo)
// TrackMaxSubscribedVideoQuality - publisher is notified of the max quality subscribers desire
TrackMaxSubscribedVideoQuality(ctx context.Context, participantID livekit.ParticipantID, track *livekit.TrackInfo, mime mime.MimeType, maxQuality livekit.VideoQuality)
TrackPublishRTPStats(ctx context.Context, participantID livekit.ParticipantID, trackID livekit.TrackID, mimeType mime.MimeType, layer int, stats *livekit.RTPStats)
TrackSubscribeRTPStats(ctx context.Context, participantID livekit.ParticipantID, trackID livekit.TrackID, mimeType mime.MimeType, stats *livekit.RTPStats)
EgressStarted(ctx context.Context, info *livekit.EgressInfo)
EgressUpdated(ctx context.Context, info *livekit.EgressInfo)
EgressEnded(ctx context.Context, info *livekit.EgressInfo)
IngressCreated(ctx context.Context, info *livekit.IngressInfo)
IngressDeleted(ctx context.Context, info *livekit.IngressInfo)
IngressStarted(ctx context.Context, info *livekit.IngressInfo)
IngressUpdated(ctx context.Context, info *livekit.IngressInfo)
IngressEnded(ctx context.Context, info *livekit.IngressInfo)
LocalRoomState(ctx context.Context, info *livekit.AnalyticsNodeRooms)
Report(ctx context.Context, reportInfo *livekit.ReportInfo)
APICall(ctx context.Context, apiCallInfo *livekit.APICallInfo)
Webhook(ctx context.Context, webhookInfo *livekit.WebhookInfo)
// helpers
AnalyticsService
NotifyEgressEvent(ctx context.Context, event string, info *livekit.EgressInfo)
FlushStats()
}
func NewTelemetryService ¶
func NewTelemetryService(notifier webhook.QueuedNotifier, analytics AnalyticsService) TelemetryService
Source Files
¶
Click to show internal directories.
Click to hide internal directories.