github.com/whoyao/protocol@v0.0.0-20230519045905-2d8ace718ca5/livekit_analytics.proto (about) 1 syntax = "proto3"; 2 3 package livekit; 4 option go_package = "github.com/livekit/protocol/livekit"; 5 option csharp_namespace = "LiveKit.Proto"; 6 option ruby_package = "LiveKit::Proto"; 7 8 import "google/protobuf/empty.proto"; 9 import "google/protobuf/timestamp.proto"; 10 import "livekit_models.proto"; 11 import "livekit_egress.proto"; 12 import "livekit_ingress.proto"; 13 14 service AnalyticsRecorderService { 15 rpc IngestStats(stream AnalyticsStats) returns (google.protobuf.Empty){}; 16 rpc IngestEvents(stream AnalyticsEvents) returns (google.protobuf.Empty){}; 17 } 18 19 enum StreamType { 20 UPSTREAM = 0; 21 DOWNSTREAM = 1; 22 } 23 24 message AnalyticsVideoLayer { 25 int32 layer = 1; 26 uint32 packets = 2; 27 uint64 bytes = 3; 28 uint32 frames = 4; 29 } 30 31 message AnalyticsStream { 32 uint32 ssrc = 1; 33 uint32 primary_packets = 2; 34 uint64 primary_bytes = 3; 35 uint32 retransmit_packets = 4; 36 uint64 retransmit_bytes = 5; 37 uint32 padding_packets = 6; 38 uint64 padding_bytes = 7; 39 uint32 packets_lost = 8; 40 uint32 frames = 9; 41 uint32 rtt = 10; 42 uint32 jitter = 11; 43 uint32 nacks = 12; 44 uint32 plis = 13; 45 uint32 firs = 14; 46 repeated AnalyticsVideoLayer video_layers = 15; 47 } 48 49 message AnalyticsStat { 50 string analytics_key = 1; 51 StreamType kind = 2; 52 google.protobuf.Timestamp time_stamp = 3; 53 string node = 4; 54 string room_id = 5; 55 string room_name = 6; 56 string participant_id = 7; 57 string track_id = 8; 58 float score = 9; // average score 59 repeated AnalyticsStream streams = 10; 60 string mime = 11; 61 float min_score = 12; 62 float median_score = 13; 63 } 64 65 message AnalyticsStats { 66 repeated AnalyticsStat stats = 1; 67 } 68 69 enum AnalyticsEventType { 70 ROOM_CREATED = 0; 71 ROOM_ENDED = 1; 72 PARTICIPANT_JOINED = 2; 73 PARTICIPANT_LEFT = 3; 74 TRACK_PUBLISHED = 4; 75 TRACK_PUBLISH_REQUESTED = 20; 76 TRACK_UNPUBLISHED = 5; 77 TRACK_SUBSCRIBED = 6; 78 TRACK_SUBSCRIBE_REQUESTED = 21; 79 TRACK_SUBSCRIBE_FAILED = 25; 80 TRACK_UNSUBSCRIBED = 7; 81 TRACK_PUBLISHED_UPDATE = 10; 82 TRACK_MUTED = 23; 83 TRACK_UNMUTED = 24; 84 TRACK_PUBLISH_STATS = 26; 85 TRACK_SUBSCRIBE_STATS = 27; 86 PARTICIPANT_ACTIVE = 11; 87 PARTICIPANT_RESUMED = 22; 88 EGRESS_STARTED = 12; 89 EGRESS_ENDED = 13; 90 TRACK_MAX_SUBSCRIBED_VIDEO_QUALITY = 14; 91 RECONNECTED = 15; 92 INGRESS_CREATED = 18; 93 INGRESS_DELETED = 19; 94 INGRESS_STARTED = 16; 95 INGRESS_ENDED = 17; 96 97 // NEXT_ID: 28 98 } 99 100 message AnalyticsClientMeta { 101 string region = 1; 102 string node = 2; 103 string client_addr = 3; 104 uint32 client_connect_time = 4; 105 // udp, tcp, turn 106 string connection_type = 5; 107 ReconnectReason reconnect_reason = 6; 108 } 109 110 message AnalyticsEvent { 111 AnalyticsEventType type = 1; 112 google.protobuf.Timestamp timestamp = 2; 113 string room_id = 3; 114 Room room = 4; 115 string participant_id = 5; 116 ParticipantInfo participant = 6; 117 string track_id = 7; 118 TrackInfo track = 8; 119 string analytics_key = 10; 120 ClientInfo client_info = 11; 121 AnalyticsClientMeta client_meta = 12; 122 string egress_id = 13; 123 string ingress_id = 19; 124 VideoQuality max_subscribed_video_quality = 14; 125 ParticipantInfo publisher = 15; 126 string mime = 16; 127 EgressInfo egress = 17; 128 IngressInfo ingress = 18; 129 string error = 20; 130 RTPStats rtp_stats = 21; 131 int32 video_layer = 22; 132 133 // NEXT_ID: 23 134 } 135 136 message AnalyticsEvents { 137 repeated AnalyticsEvent events = 1; 138 }