Documentation
¶
Index ¶
- type AnalyticsService
- type CondensedStat
- type Conn
- type Listener
- type NullAnalyticService
- func (n NullAnalyticService) RoomProjectReporter(_ctx context.Context) roomobs.ProjectReporter
- func (n NullAnalyticService) SendEvent(_ context.Context, _ *livekit.AnalyticsEvent)
- func (n NullAnalyticService) SendNodeRoomStates(_ context.Context, _ *livekit.AnalyticsNodeRooms)
- func (n NullAnalyticService) SendStats(_ context.Context, _ []*livekit.AnalyticsStat)
- type NullTelemetryService
- func (n NullTelemetryService) APICall(ctx context.Context, apiCallInfo *livekit.APICallInfo)
- func (n NullTelemetryService) EgressEnded(ctx context.Context, info *livekit.EgressInfo)
- func (n NullTelemetryService) EgressStarted(ctx context.Context, info *livekit.EgressInfo)
- func (n NullTelemetryService) EgressUpdated(ctx context.Context, info *livekit.EgressInfo)
- func (n NullTelemetryService) FlushStats()
- func (n NullTelemetryService) IngressCreated(ctx context.Context, info *livekit.IngressInfo)
- func (n NullTelemetryService) IngressDeleted(ctx context.Context, info *livekit.IngressInfo)
- func (n NullTelemetryService) IngressEnded(ctx context.Context, info *livekit.IngressInfo)
- func (n NullTelemetryService) IngressStarted(ctx context.Context, info *livekit.IngressInfo)
- func (n NullTelemetryService) IngressUpdated(ctx context.Context, info *livekit.IngressInfo)
- func (n NullTelemetryService) LocalRoomState(ctx context.Context, info *livekit.AnalyticsNodeRooms)
- func (n NullTelemetryService) NotifyEgressEvent(ctx context.Context, event string, info *livekit.EgressInfo)
- func (n NullTelemetryService) ParticipantActive(ctx context.Context, room *livekit.Room, participant *livekit.ParticipantInfo, ...)
- func (n NullTelemetryService) ParticipantJoined(ctx context.Context, room *livekit.Room, participant *livekit.ParticipantInfo, ...)
- func (n NullTelemetryService) ParticipantLeft(ctx context.Context, room *livekit.Room, participant *livekit.ParticipantInfo, ...)
- func (n NullTelemetryService) ParticipantResumed(ctx context.Context, room *livekit.Room, participant *livekit.ParticipantInfo, ...)
- func (n NullTelemetryService) Report(ctx context.Context, reportInfo *livekit.ReportInfo)
- func (n NullTelemetryService) RoomEnded(ctx context.Context, room *livekit.Room)
- func (n NullTelemetryService) RoomStarted(ctx context.Context, room *livekit.Room)
- func (n NullTelemetryService) TrackMaxSubscribedVideoQuality(ctx context.Context, roomID livekit.RoomID, roomName livekit.RoomName, ...)
- func (n NullTelemetryService) TrackMuted(ctx context.Context, roomID livekit.RoomID, roomName livekit.RoomName, ...)
- func (n NullTelemetryService) TrackPublishRTPStats(ctx context.Context, roomID livekit.RoomID, roomName livekit.RoomName, ...)
- func (n NullTelemetryService) TrackPublishRequested(ctx context.Context, roomID livekit.RoomID, roomName livekit.RoomName, ...)
- func (n NullTelemetryService) TrackPublished(ctx context.Context, roomID livekit.RoomID, roomName livekit.RoomName, ...)
- func (n NullTelemetryService) TrackPublishedUpdate(ctx context.Context, roomID livekit.RoomID, roomName livekit.RoomName, ...)
- func (n NullTelemetryService) TrackStats(roomID livekit.RoomID, roomName livekit.RoomName, key StatsKey, ...)
- func (n NullTelemetryService) TrackSubscribeFailed(ctx context.Context, roomID livekit.RoomID, roomName livekit.RoomName, ...)
- func (n NullTelemetryService) TrackSubscribeRTPStats(ctx context.Context, roomID livekit.RoomID, roomName livekit.RoomName, ...)
- func (n NullTelemetryService) TrackSubscribeRequested(ctx context.Context, roomID livekit.RoomID, roomName livekit.RoomName, ...)
- func (n NullTelemetryService) TrackSubscribed(ctx context.Context, roomID livekit.RoomID, roomName livekit.RoomName, ...)
- func (n NullTelemetryService) TrackUnmuted(ctx context.Context, roomID livekit.RoomID, roomName livekit.RoomName, ...)
- func (n NullTelemetryService) TrackUnpublished(ctx context.Context, roomID livekit.RoomID, roomName livekit.RoomName, ...)
- func (n NullTelemetryService) TrackUnsubscribed(ctx context.Context, roomID livekit.RoomID, roomName livekit.RoomName, ...)
- func (n NullTelemetryService) Webhook(ctx context.Context, webhookInfo *livekit.WebhookInfo)
- type PacketConn
- type ReferenceCount
- type ReferenceGuard
- type RelayAddressGenerator
- func (g *RelayAddressGenerator) AllocateConn(c turn.AllocateConnConfig) (net.Conn, error)
- func (g *RelayAddressGenerator) AllocateListener(c turn.AllocateListenerConfig) (net.Listener, net.Addr, error)
- func (g *RelayAddressGenerator) AllocatePacketConn(c turn.AllocateListenerConfig) (net.PacketConn, net.Addr, error)
- 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, closeWait time.Duration) bool
- func (s *StatsWorker) IsConnected() bool
- func (s *StatsWorker) MarshalLogObject(e zapcore.ObjectEncoder) error
- func (s *StatsWorker) OnTrackStat(trackID livekit.TrackID, direction livekit.StreamType, ...)
- func (s *StatsWorker) ParticipantID() livekit.ParticipantID
- func (s *StatsWorker) SetConnected()
- type TelemetryService
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AnalyticsService ¶
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 ¶
func NewAnalyticsService(_ *config.Config, currentNode routing.LocalNode) AnalyticsService
type CondensedStat ¶
type CondensedStat struct {
StartTime time.Time
EndTime time.Time
Bytes uint64
Packets uint32
PacketsLost uint32
Frames uint32
}
func CondenseStat ¶
func CondenseStat(stat *livekit.AnalyticsStat) (ps CondensedStat, ok bool)
type Listener ¶
func NewListener ¶
type NullAnalyticService ¶
type NullAnalyticService struct{}
func (NullAnalyticService) RoomProjectReporter ¶
func (n NullAnalyticService) RoomProjectReporter(_ctx context.Context) roomobs.ProjectReporter
func (NullAnalyticService) SendEvent ¶
func (n NullAnalyticService) SendEvent(_ context.Context, _ *livekit.AnalyticsEvent)
func (NullAnalyticService) SendNodeRoomStates ¶
func (n NullAnalyticService) SendNodeRoomStates(_ context.Context, _ *livekit.AnalyticsNodeRooms)
func (NullAnalyticService) SendStats ¶
func (n NullAnalyticService) SendStats(_ context.Context, _ []*livekit.AnalyticsStat)
type NullTelemetryService ¶
type NullTelemetryService struct {
NullAnalyticService
}
func (NullTelemetryService) APICall ¶
func (n NullTelemetryService) APICall(ctx context.Context, apiCallInfo *livekit.APICallInfo)
func (NullTelemetryService) EgressEnded ¶
func (n NullTelemetryService) EgressEnded(ctx context.Context, info *livekit.EgressInfo)
func (NullTelemetryService) EgressStarted ¶
func (n NullTelemetryService) EgressStarted(ctx context.Context, info *livekit.EgressInfo)
func (NullTelemetryService) EgressUpdated ¶
func (n NullTelemetryService) EgressUpdated(ctx context.Context, info *livekit.EgressInfo)
func (NullTelemetryService) FlushStats ¶
func (n NullTelemetryService) FlushStats()
func (NullTelemetryService) IngressCreated ¶
func (n NullTelemetryService) IngressCreated(ctx context.Context, info *livekit.IngressInfo)
func (NullTelemetryService) IngressDeleted ¶
func (n NullTelemetryService) IngressDeleted(ctx context.Context, info *livekit.IngressInfo)
func (NullTelemetryService) IngressEnded ¶
func (n NullTelemetryService) IngressEnded(ctx context.Context, info *livekit.IngressInfo)
func (NullTelemetryService) IngressStarted ¶
func (n NullTelemetryService) IngressStarted(ctx context.Context, info *livekit.IngressInfo)
func (NullTelemetryService) IngressUpdated ¶
func (n NullTelemetryService) IngressUpdated(ctx context.Context, info *livekit.IngressInfo)
func (NullTelemetryService) LocalRoomState ¶
func (n NullTelemetryService) LocalRoomState(ctx context.Context, info *livekit.AnalyticsNodeRooms)
func (NullTelemetryService) NotifyEgressEvent ¶
func (n NullTelemetryService) NotifyEgressEvent(ctx context.Context, event string, info *livekit.EgressInfo)
func (NullTelemetryService) ParticipantActive ¶
func (n NullTelemetryService) ParticipantActive(ctx context.Context, room *livekit.Room, participant *livekit.ParticipantInfo, clientMeta *livekit.AnalyticsClientMeta, isMigration bool, guard *ReferenceGuard)
func (NullTelemetryService) ParticipantJoined ¶
func (n NullTelemetryService) ParticipantJoined(ctx context.Context, room *livekit.Room, participant *livekit.ParticipantInfo, clientInfo *livekit.ClientInfo, clientMeta *livekit.AnalyticsClientMeta, shouldSendEvent bool, guard *ReferenceGuard)
func (NullTelemetryService) ParticipantLeft ¶
func (n NullTelemetryService) ParticipantLeft(ctx context.Context, room *livekit.Room, participant *livekit.ParticipantInfo, shouldSendEvent bool, guard *ReferenceGuard)
func (NullTelemetryService) ParticipantResumed ¶
func (n NullTelemetryService) ParticipantResumed(ctx context.Context, room *livekit.Room, participant *livekit.ParticipantInfo, nodeID livekit.NodeID, reason livekit.ReconnectReason)
func (NullTelemetryService) Report ¶
func (n NullTelemetryService) Report(ctx context.Context, reportInfo *livekit.ReportInfo)
func (NullTelemetryService) RoomEnded ¶
func (n NullTelemetryService) RoomEnded(ctx context.Context, room *livekit.Room)
func (NullTelemetryService) RoomStarted ¶
func (n NullTelemetryService) RoomStarted(ctx context.Context, room *livekit.Room)
func (NullTelemetryService) TrackMaxSubscribedVideoQuality ¶
func (n NullTelemetryService) TrackMaxSubscribedVideoQuality(ctx context.Context, roomID livekit.RoomID, roomName livekit.RoomName, participantID livekit.ParticipantID, track *livekit.TrackInfo, mime mime.MimeType, maxQuality livekit.VideoQuality)
func (NullTelemetryService) TrackMuted ¶
func (NullTelemetryService) TrackPublishRTPStats ¶
func (NullTelemetryService) TrackPublishRequested ¶
func (n NullTelemetryService) TrackPublishRequested(ctx context.Context, roomID livekit.RoomID, roomName livekit.RoomName, participantID livekit.ParticipantID, identity livekit.ParticipantIdentity, track *livekit.TrackInfo)
func (NullTelemetryService) TrackPublished ¶
func (n NullTelemetryService) TrackPublished(ctx context.Context, roomID livekit.RoomID, roomName livekit.RoomName, participantID livekit.ParticipantID, identity livekit.ParticipantIdentity, track *livekit.TrackInfo, shouldSendEvent bool)
func (NullTelemetryService) TrackPublishedUpdate ¶
func (NullTelemetryService) TrackStats ¶
func (n NullTelemetryService) TrackStats(roomID livekit.RoomID, roomName livekit.RoomName, key StatsKey, stat *livekit.AnalyticsStat)
func (NullTelemetryService) TrackSubscribeFailed ¶
func (NullTelemetryService) TrackSubscribeRTPStats ¶
func (NullTelemetryService) TrackSubscribeRequested ¶
func (NullTelemetryService) TrackSubscribed ¶
func (n NullTelemetryService) TrackSubscribed(ctx context.Context, roomID livekit.RoomID, roomName livekit.RoomName, participantID livekit.ParticipantID, track *livekit.TrackInfo, publisher *livekit.ParticipantInfo, shouldSendEvent bool)
func (NullTelemetryService) TrackUnmuted ¶
func (NullTelemetryService) TrackUnpublished ¶
func (n NullTelemetryService) TrackUnpublished(ctx context.Context, roomID livekit.RoomID, roomName livekit.RoomName, participantID livekit.ParticipantID, identity livekit.ParticipantIdentity, track *livekit.TrackInfo, shouldSendEvent bool)
func (NullTelemetryService) TrackUnsubscribed ¶
func (NullTelemetryService) Webhook ¶
func (n NullTelemetryService) Webhook(ctx context.Context, webhookInfo *livekit.WebhookInfo)
type PacketConn ¶
type PacketConn struct {
net.PacketConn
// contains filtered or unexported fields
}
func NewPacketConn ¶
func NewPacketConn(c net.PacketConn, direction prometheus.Direction) *PacketConn
func (*PacketConn) Close ¶
func (c *PacketConn) Close() error
type ReferenceCount ¶
type ReferenceCount struct {
// contains filtered or unexported fields
}
func (*ReferenceCount) Activate ¶
func (s *ReferenceCount) Activate(guard *ReferenceGuard)
func (ReferenceCount) MarshalLogObject ¶
func (s ReferenceCount) MarshalLogObject(e zapcore.ObjectEncoder) error
func (*ReferenceCount) Release ¶
func (s *ReferenceCount) Release(guard *ReferenceGuard) bool
type ReferenceGuard ¶
type ReferenceGuard struct {
// contains filtered or unexported fields
}
type RelayAddressGenerator ¶
type RelayAddressGenerator struct {
turn.RelayAddressGenerator
}
func NewRelayAddressGenerator ¶
func NewRelayAddressGenerator(g turn.RelayAddressGenerator) *RelayAddressGenerator
func (*RelayAddressGenerator) AllocateConn ¶
func (g *RelayAddressGenerator) AllocateConn(c turn.AllocateConnConfig) (net.Conn, error)
func (*RelayAddressGenerator) AllocateListener ¶
func (g *RelayAddressGenerator) AllocateListener(c turn.AllocateListenerConfig) (net.Listener, net.Addr, error)
func (*RelayAddressGenerator) AllocatePacketConn ¶
func (g *RelayAddressGenerator) AllocatePacketConn(c turn.AllocateListenerConfig) (net.PacketConn, net.Addr, error)
type StatsKey ¶
type StatsKey struct {
// contains filtered or unexported fields
}
func StatsKeyForData ¶
func StatsKeyForData( country string, streamType livekit.StreamType, participantID livekit.ParticipantID, trackID livekit.TrackID, ) StatsKey
func StatsKeyForTrack ¶
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 ¶
func (s *StatsWorker) Closed(guard *ReferenceGuard) bool
func (*StatsWorker) IsConnected ¶
func (s *StatsWorker) IsConnected() bool
func (*StatsWorker) MarshalLogObject ¶
func (s *StatsWorker) MarshalLogObject(e zapcore.ObjectEncoder) error
func (*StatsWorker) OnTrackStat ¶
func (s *StatsWorker) OnTrackStat(trackID livekit.TrackID, direction livekit.StreamType, stat *livekit.AnalyticsStat)
func (*StatsWorker) ParticipantID ¶
func (s *StatsWorker) ParticipantID() livekit.ParticipantID
func (*StatsWorker) SetConnected ¶
func (s *StatsWorker) SetConnected()
type TelemetryService ¶
type TelemetryService interface {
// TrackStats is called periodically for each track in both directions (published/subscribed)
TrackStats(roomID livekit.RoomID, roomName livekit.RoomName, 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, roomID livekit.RoomID, roomName livekit.RoomName, participantID livekit.ParticipantID, identity livekit.ParticipantIdentity, track *livekit.TrackInfo)
// TrackPublished - a publication attempt has been successful
TrackPublished(ctx context.Context, roomID livekit.RoomID, roomName livekit.RoomName, participantID livekit.ParticipantID, identity livekit.ParticipantIdentity, track *livekit.TrackInfo, shouldSendEvent bool)
// TrackUnpublished - a participant unpublished a track
TrackUnpublished(ctx context.Context, roomID livekit.RoomID, roomName livekit.RoomName, participantID livekit.ParticipantID, identity livekit.ParticipantIdentity, track *livekit.TrackInfo, shouldSendEvent bool)
// TrackSubscribeRequested - a participant requested to subscribe to a track
TrackSubscribeRequested(ctx context.Context, roomID livekit.RoomID, roomName livekit.RoomName, participantID livekit.ParticipantID, track *livekit.TrackInfo)
// TrackSubscribed - a participant subscribed to a track successfully
TrackSubscribed(ctx context.Context, roomID livekit.RoomID, roomName livekit.RoomName, participantID livekit.ParticipantID, track *livekit.TrackInfo, publisher *livekit.ParticipantInfo, shouldSendEvent bool)
// TrackUnsubscribed - a participant unsubscribed from a track successfully
TrackUnsubscribed(ctx context.Context, roomID livekit.RoomID, roomName livekit.RoomName, participantID livekit.ParticipantID, track *livekit.TrackInfo, shouldSendEvent bool)
// TrackSubscribeFailed - failure to subscribe to a track
TrackSubscribeFailed(ctx context.Context, roomID livekit.RoomID, roomName livekit.RoomName, participantID livekit.ParticipantID, trackID livekit.TrackID, err error, isUserError bool)
// TrackMuted - the publisher has muted the Track
TrackMuted(ctx context.Context, roomID livekit.RoomID, roomName livekit.RoomName, participantID livekit.ParticipantID, track *livekit.TrackInfo)
// TrackUnmuted - the publisher has muted the Track
TrackUnmuted(ctx context.Context, roomID livekit.RoomID, roomName livekit.RoomName, participantID livekit.ParticipantID, track *livekit.TrackInfo)
// TrackPublishedUpdate - track metadata has been updated
TrackPublishedUpdate(ctx context.Context, roomID livekit.RoomID, roomName livekit.RoomName, participantID livekit.ParticipantID, track *livekit.TrackInfo)
// TrackMaxSubscribedVideoQuality - publisher is notified of the max quality subscribers desire
TrackMaxSubscribedVideoQuality(ctx context.Context, roomID livekit.RoomID, roomName livekit.RoomName, participantID livekit.ParticipantID, track *livekit.TrackInfo, mime mime.MimeType, maxQuality livekit.VideoQuality)
TrackPublishRTPStats(ctx context.Context, roomID livekit.RoomID, roomName livekit.RoomName, participantID livekit.ParticipantID, trackID livekit.TrackID, mimeType mime.MimeType, layer int, stats *livekit.RTPStats)
TrackSubscribeRTPStats(ctx context.Context, roomID livekit.RoomID, roomName livekit.RoomName, 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.