telemetry

package
v0.0.0-...-8458c4d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 12, 2026 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

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 Conn

type Conn struct {
	net.Conn
	// contains filtered or unexported fields
}

func NewConn

func NewConn(c net.Conn, direction prometheus.Direction) *Conn

func (*Conn) Close

func (c *Conn) Close() error

func (*Conn) Read

func (c *Conn) Read(b []byte) (n int, err error)

func (*Conn) Write

func (c *Conn) Write(b []byte) (n int, err error)

type Listener

type Listener struct {
	net.Listener
}

func NewListener

func NewListener(l net.Listener) *Listener

func (*Listener) Accept

func (l *Listener) Accept() (net.Conn, error)

type NullAnalyticService

type NullAnalyticService struct{}

func (NullAnalyticService) RoomProjectReporter

func (n NullAnalyticService) RoomProjectReporter(_ctx context.Context) roomobs.ProjectReporter

func (NullAnalyticService) SendEvent

func (NullAnalyticService) SendNodeRoomStates

func (n NullAnalyticService) SendNodeRoomStates(_ context.Context, _ *livekit.AnalyticsNodeRooms)

func (NullAnalyticService) SendStats

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 (n NullTelemetryService) TrackMuted(ctx context.Context, roomID livekit.RoomID, roomName livekit.RoomName, participantID livekit.ParticipantID, track *livekit.TrackInfo)

func (NullTelemetryService) TrackPublishRTPStats

func (n NullTelemetryService) TrackPublishRTPStats(ctx context.Context, roomID livekit.RoomID, roomName livekit.RoomName, participantID livekit.ParticipantID, trackID livekit.TrackID, mimeType mime.MimeType, layer int, stats *livekit.RTPStats)

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 (n NullTelemetryService) TrackPublishedUpdate(ctx context.Context, roomID livekit.RoomID, roomName livekit.RoomName, participantID livekit.ParticipantID, track *livekit.TrackInfo)

func (NullTelemetryService) TrackStats

func (n NullTelemetryService) TrackStats(roomID livekit.RoomID, roomName livekit.RoomName, key StatsKey, stat *livekit.AnalyticsStat)

func (NullTelemetryService) TrackSubscribeFailed

func (n NullTelemetryService) TrackSubscribeFailed(ctx context.Context, roomID livekit.RoomID, roomName livekit.RoomName, participantID livekit.ParticipantID, trackID livekit.TrackID, err error, isUserError bool)

func (NullTelemetryService) TrackSubscribeRTPStats

func (n NullTelemetryService) TrackSubscribeRTPStats(ctx context.Context, roomID livekit.RoomID, roomName livekit.RoomName, participantID livekit.ParticipantID, trackID livekit.TrackID, mimeType mime.MimeType, stats *livekit.RTPStats)

func (NullTelemetryService) TrackSubscribeRequested

func (n NullTelemetryService) TrackSubscribeRequested(ctx context.Context, roomID livekit.RoomID, roomName livekit.RoomName, participantID livekit.ParticipantID, track *livekit.TrackInfo)

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 (n NullTelemetryService) TrackUnmuted(ctx context.Context, roomID livekit.RoomID, roomName livekit.RoomName, participantID livekit.ParticipantID, track *livekit.TrackInfo)

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 (n NullTelemetryService) TrackUnsubscribed(ctx context.Context, roomID livekit.RoomID, roomName livekit.RoomName, participantID livekit.ParticipantID, track *livekit.TrackInfo, shouldSendEvent bool)

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

func (*PacketConn) ReadFrom

func (c *PacketConn) ReadFrom(p []byte) (n int, addr net.Addr, err error)

func (*PacketConn) WriteTo

func (c *PacketConn) WriteTo(p []byte, addr net.Addr) (n int, err 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 (*RelayAddressGenerator) AllocateConn

func (*RelayAddressGenerator) AllocateListener

func (*RelayAddressGenerator) AllocatePacketConn

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) Flush

func (s *StatsWorker) Flush(now time.Time, closeWait time.Duration) 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

Directories

Path Synopsis
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL