add session start time metric (#2377)

This commit is contained in:
Paul Wells
2024-01-11 23:23:51 -08:00
committed by GitHub
parent 3687396d84
commit 2fe2a9c9f2
4 changed files with 20 additions and 0 deletions
+2
View File
@@ -97,6 +97,7 @@ type ParticipantParams struct {
AudioConfig config.AudioConfig
VideoConfig config.VideoConfig
ProtocolVersion types.ProtocolVersion
SessionStartTime time.Time
Telemetry telemetry.TelemetryService
Trailer []byte
PLIThrottleConfig config.PLIThrottleConfig
@@ -1421,6 +1422,7 @@ func (p *ParticipantImpl) onPrimaryTransportInitialConnected() {
}
func (p *ParticipantImpl) onPrimaryTransportFullyEstablished() {
prometheus.RecordSessionStartTime(int(p.ProtocolVersion()), time.Since(p.params.SessionStartTime))
p.updateState(livekit.ParticipantInfo_ACTIVE)
}
+1
View File
@@ -753,6 +753,7 @@ func newParticipantForTestWithOpts(identity livekit.ParticipantIdentity, opts *p
Config: rtcConf,
Sink: &routingfakes.FakeMessageSink{},
ProtocolVersion: opts.protocolVersion,
SessionStartTime: time.Now(),
PLIThrottleConfig: conf.RTC.PLIThrottle,
Grants: grants,
PublishEnabledCodecs: enabledCodecs,