github.com/livekit/protocol@v1.39.3/protobufs/livekit_internal.proto (about) 1 // Copyright 2023 LiveKit, Inc. 2 // 3 // Licensed under the Apache License, Version 2.0 (the "License"); 4 // you may not use this file except in compliance with the License. 5 // You may obtain a copy of the License at 6 // 7 // http://www.apache.org/licenses/LICENSE-2.0 8 // 9 // Unless required by applicable law or agreed to in writing, software 10 // distributed under the License is distributed on an "AS IS" BASIS, 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 // See the License for the specific language governing permissions and 13 // limitations under the License. 14 15 syntax = "proto3"; 16 17 package livekit; 18 option go_package = "github.com/livekit/protocol/livekit"; 19 option csharp_namespace = "LiveKit.Proto"; 20 option ruby_package = "LiveKit::Proto"; 21 22 // internal protos, not exposed to clients 23 import "livekit_models.proto"; 24 import "livekit_egress.proto"; 25 import "livekit_agent_dispatch.proto"; 26 import "livekit_room.proto"; 27 28 enum NodeType { 29 SERVER = 0; 30 CONTROLLER = 1; 31 MEDIA = 2; 32 TURN = 4; 33 SWEEPER = 5; 34 DIRECTOR = 6; 35 HOSTED_AGENT = 7; 36 } 37 38 enum NodeState { 39 STARTING_UP = 0; 40 SERVING = 1; 41 SHUTTING_DOWN = 2; 42 } 43 44 message Node { 45 string id = 1; 46 string ip = 2; 47 uint32 num_cpus = 3; 48 NodeStats stats = 4; 49 NodeType type = 5; 50 NodeState state = 6; 51 string region = 7; 52 } 53 54 message NodeStats { 55 // when server was started 56 int64 started_at = 1; 57 // when server last reported its status 58 int64 updated_at = 2; 59 60 // room 61 int32 num_rooms = 3; 62 int32 num_clients = 4; 63 int32 num_tracks_in = 5; 64 int32 num_tracks_out = 6; 65 int32 num_track_publish_attempts = 36; 66 float track_publish_attempts_per_sec = 37 [deprecated=true]; 67 int32 num_track_publish_success = 38; 68 float track_publish_success_per_sec = 39 [deprecated=true]; 69 int32 num_track_subscribe_attempts = 40; 70 float track_subscribe_attempts_per_sec = 41 [deprecated=true]; 71 int32 num_track_subscribe_success = 42; 72 float track_subscribe_success_per_sec = 43 [deprecated=true]; 73 74 // packet 75 uint64 bytes_in = 7; 76 uint64 bytes_out = 8; 77 uint64 packets_in = 9; 78 uint64 packets_out = 10; 79 uint64 nack_total = 11; 80 float bytes_in_per_sec = 12 [deprecated=true]; 81 float bytes_out_per_sec = 13 [deprecated=true]; 82 float packets_in_per_sec = 14 [deprecated=true]; 83 float packets_out_per_sec = 15 [deprecated=true]; 84 float nack_per_sec = 16 [deprecated=true]; 85 86 // system 87 uint32 num_cpus = 17; 88 float load_avg_last1min = 18; 89 float load_avg_last5min = 19; 90 float load_avg_last15min = 20; 91 float cpu_load = 21; 92 float memory_load = 33 [deprecated=true]; 93 uint64 memory_total = 34; 94 uint64 memory_used = 35; 95 uint32 sys_packets_out = 28; 96 uint32 sys_packets_dropped = 29; 97 float sys_packets_out_per_sec = 30 [deprecated=true]; 98 float sys_packets_dropped_per_sec = 31 [deprecated=true]; 99 float sys_packets_dropped_pct_per_sec = 32 [deprecated=true]; 100 101 // retransmissions 102 uint64 retransmit_bytes_out = 22; 103 uint64 retransmit_packets_out = 23; 104 float retransmit_bytes_out_per_sec = 24 [deprecated=true]; 105 float retransmit_packets_out_per_sec = 25 [deprecated=true]; 106 107 // participant joins 108 uint64 participant_signal_connected = 26; 109 float participant_signal_connected_per_sec = 27 [deprecated=true]; 110 uint64 participant_rtc_connected = 44; 111 float participant_rtc_connected_per_sec = 45 [deprecated=true]; 112 uint64 participant_rtc_init = 46; 113 float participant_rtc_init_per_sec = 47 [deprecated=true]; 114 115 // forward metrics 116 uint32 forward_latency = 48; 117 uint32 forward_jitter = 49; 118 119 repeated NodeStatsRate rates = 50; 120 121 // NEXT ID: 51 122 } 123 124 // rates of different node stats (per second) 125 message NodeStatsRate { 126 int64 started_at = 1; 127 int64 ended_at = 2; 128 int64 duration = 3; 129 130 float track_publish_attempts = 4; 131 float track_publish_success = 5; 132 float track_subscribe_attempts = 6; 133 float track_subscribe_success = 7; 134 135 float bytes_in = 8; 136 float bytes_out = 9; 137 float packets_in = 10; 138 float packets_out = 11; 139 float nack_total = 12; 140 141 float sys_packets_out = 13; 142 float sys_packets_dropped = 14; 143 144 float retransmit_bytes_out = 15; 145 float retransmit_packets_out = 16; 146 147 float participant_signal_connected = 17; 148 float participant_rtc_connected = 18; 149 float participant_rtc_init = 19; 150 151 // time weighted averages across stats windows forming part of a rate measurement interval 152 float cpu_load = 20; 153 float memory_load = 21; 154 float memory_used = 22; 155 float memory_total = 23; 156 157 // NEXT ID: 24 158 } 159 160 message StartSession { 161 string room_name = 1; 162 string identity = 2; 163 string connection_id = 3; 164 // if a client is reconnecting (i.e. resume instead of restart) 165 bool reconnect = 4; 166 bool auto_subscribe = 9; 167 bool hidden = 10; 168 ClientInfo client = 11; 169 bool recorder = 12; 170 string name = 13; 171 // A user's ClaimGrants serialized in JSON 172 string grants_json = 14; 173 bool adaptive_stream = 15; 174 //if reconnect, client will set current sid 175 string participant_id = 16; 176 ReconnectReason reconnect_reason = 17; 177 optional bool subscriber_allow_pause = 18; 178 bool disable_ice_lite = 19; 179 livekit.CreateRoomRequest create_room = 20; 180 } 181 182 // room info that should not be returned to clients 183 message RoomInternal { 184 AutoTrackEgress track_egress = 1; 185 AutoParticipantEgress participant_egress = 2; 186 PlayoutDelay playout_delay = 3; 187 repeated RoomAgentDispatch agent_dispatches = 5; 188 bool sync_streams = 4; 189 bool replay_enabled = 6; 190 } 191 192 enum ICECandidateType { 193 ICT_NONE = 0; 194 ICT_TCP = 1; 195 ICT_TLS = 2; 196 } 197 198 message ICEConfig { 199 ICECandidateType preference_subscriber = 1; 200 ICECandidateType preference_publisher = 2; 201 }