From 6410d008bf7b091591b72a35bc154cc001f4f1a5 Mon Sep 17 00:00:00 2001 From: cnderrauber Date: Fri, 24 May 2024 14:14:35 +0800 Subject: [PATCH] Add forward metrics (#722) * Add forward metrics * generated protobuf --------- Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com> --- livekit/livekit_internal.pb.go | 26 ++++++++++++++++++++++++-- protobufs/livekit_internal.proto | 6 +++++- 2 files changed, 29 insertions(+), 3 deletions(-) diff --git a/livekit/livekit_internal.pb.go b/livekit/livekit_internal.pb.go index 6f82248e..a9c5e02e 100644 --- a/livekit/livekit_internal.pb.go +++ b/livekit/livekit_internal.pb.go @@ -344,6 +344,9 @@ type NodeStats struct { ParticipantRtcConnectedPerSec float32 `protobuf:"fixed32,45,opt,name=participant_rtc_connected_per_sec,json=participantRtcConnectedPerSec,proto3" json:"participant_rtc_connected_per_sec,omitempty"` ParticipantRtcInit uint64 `protobuf:"varint,46,opt,name=participant_rtc_init,json=participantRtcInit,proto3" json:"participant_rtc_init,omitempty"` ParticipantRtcInitPerSec float32 `protobuf:"fixed32,47,opt,name=participant_rtc_init_per_sec,json=participantRtcInitPerSec,proto3" json:"participant_rtc_init_per_sec,omitempty"` + // forward metrics + ForwardLatency uint32 `protobuf:"varint,48,opt,name=forward_latency,json=forwardLatency,proto3" json:"forward_latency,omitempty"` + ForwardJitter uint32 `protobuf:"varint,49,opt,name=forward_jitter,json=forwardJitter,proto3" json:"forward_jitter,omitempty"` } func (x *NodeStats) Reset() { @@ -707,6 +710,20 @@ func (x *NodeStats) GetParticipantRtcInitPerSec() float32 { return 0 } +func (x *NodeStats) GetForwardLatency() uint32 { + if x != nil { + return x.ForwardLatency + } + return 0 +} + +func (x *NodeStats) GetForwardJitter() uint32 { + if x != nil { + return x.ForwardJitter + } + return 0 +} + type StartSession struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -1009,7 +1026,7 @@ var file_livekit_internal_proto_rawDesc = []byte{ 0x0e, 0x32, 0x12, 0x2e, 0x6c, 0x69, 0x76, 0x65, 0x6b, 0x69, 0x74, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, 0x65, - 0x67, 0x69, 0x6f, 0x6e, 0x22, 0xee, 0x11, 0x0a, 0x09, 0x4e, 0x6f, 0x64, 0x65, 0x53, 0x74, 0x61, + 0x67, 0x69, 0x6f, 0x6e, 0x22, 0xbe, 0x12, 0x0a, 0x09, 0x4e, 0x6f, 0x64, 0x65, 0x53, 0x74, 0x61, 0x74, 0x73, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x72, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x73, 0x74, 0x61, 0x72, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, @@ -1152,7 +1169,12 @@ var file_livekit_internal_proto_rawDesc = []byte{ 0x70, 0x61, 0x6e, 0x74, 0x5f, 0x72, 0x74, 0x63, 0x5f, 0x69, 0x6e, 0x69, 0x74, 0x5f, 0x70, 0x65, 0x72, 0x5f, 0x73, 0x65, 0x63, 0x18, 0x2f, 0x20, 0x01, 0x28, 0x02, 0x52, 0x18, 0x70, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x52, 0x74, 0x63, 0x49, 0x6e, 0x69, 0x74, 0x50, - 0x65, 0x72, 0x53, 0x65, 0x63, 0x22, 0xb2, 0x04, 0x0a, 0x0c, 0x53, 0x74, 0x61, 0x72, 0x74, 0x53, + 0x65, 0x72, 0x53, 0x65, 0x63, 0x12, 0x27, 0x0a, 0x0f, 0x66, 0x6f, 0x72, 0x77, 0x61, 0x72, 0x64, + 0x5f, 0x6c, 0x61, 0x74, 0x65, 0x6e, 0x63, 0x79, 0x18, 0x30, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0e, + 0x66, 0x6f, 0x72, 0x77, 0x61, 0x72, 0x64, 0x4c, 0x61, 0x74, 0x65, 0x6e, 0x63, 0x79, 0x12, 0x25, + 0x0a, 0x0e, 0x66, 0x6f, 0x72, 0x77, 0x61, 0x72, 0x64, 0x5f, 0x6a, 0x69, 0x74, 0x74, 0x65, 0x72, + 0x18, 0x31, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0d, 0x66, 0x6f, 0x72, 0x77, 0x61, 0x72, 0x64, 0x4a, + 0x69, 0x74, 0x74, 0x65, 0x72, 0x22, 0xb2, 0x04, 0x0a, 0x0c, 0x53, 0x74, 0x61, 0x72, 0x74, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1b, 0x0a, 0x09, 0x72, 0x6f, 0x6f, 0x6d, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x72, 0x6f, 0x6f, 0x6d, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x18, diff --git a/protobufs/livekit_internal.proto b/protobufs/livekit_internal.proto index f2242824..aacb2739 100644 --- a/protobufs/livekit_internal.proto +++ b/protobufs/livekit_internal.proto @@ -109,7 +109,11 @@ message NodeStats { uint64 participant_rtc_init = 46; float participant_rtc_init_per_sec = 47; - // NEXT ID: 48 + // forward metrics + uint32 forward_latency = 48; + uint32 forward_jitter = 49; + + // NEXT ID: 50 } message StartSession {