forked from livekit/protocol
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlivekit_analytics.proto
154 lines (139 loc) · 3.8 KB
/
livekit_analytics.proto
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
// Copyright 2023 LiveKit, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
syntax = "proto3";
package livekit;
option go_package = "github.com/livekit/protocol/livekit";
option csharp_namespace = "LiveKit.Proto";
option ruby_package = "LiveKit::Proto";
import "google/protobuf/empty.proto";
import "google/protobuf/timestamp.proto";
import "livekit_models.proto";
import "livekit_egress.proto";
import "livekit_ingress.proto";
service AnalyticsRecorderService {
rpc IngestStats(stream AnalyticsStats) returns (google.protobuf.Empty){};
rpc IngestEvents(stream AnalyticsEvents) returns (google.protobuf.Empty){};
}
enum StreamType {
UPSTREAM = 0;
DOWNSTREAM = 1;
}
message AnalyticsVideoLayer {
int32 layer = 1;
uint32 packets = 2;
uint64 bytes = 3;
uint32 frames = 4;
}
message AnalyticsStream {
uint32 ssrc = 1;
uint32 primary_packets = 2;
uint64 primary_bytes = 3;
uint32 retransmit_packets = 4;
uint64 retransmit_bytes = 5;
uint32 padding_packets = 6;
uint64 padding_bytes = 7;
uint32 packets_lost = 8;
uint32 frames = 9;
uint32 rtt = 10;
uint32 jitter = 11;
uint32 nacks = 12;
uint32 plis = 13;
uint32 firs = 14;
repeated AnalyticsVideoLayer video_layers = 15;
}
message AnalyticsStat {
string analytics_key = 1;
StreamType kind = 2;
google.protobuf.Timestamp time_stamp = 3;
string node = 4;
string room_id = 5;
string room_name = 6;
string participant_id = 7;
string track_id = 8;
float score = 9; // average score
repeated AnalyticsStream streams = 10;
string mime = 11;
float min_score = 12;
float median_score = 13;
}
message AnalyticsStats {
repeated AnalyticsStat stats = 1;
}
enum AnalyticsEventType {
ROOM_CREATED = 0;
ROOM_ENDED = 1;
PARTICIPANT_JOINED = 2;
PARTICIPANT_LEFT = 3;
TRACK_PUBLISHED = 4;
TRACK_PUBLISH_REQUESTED = 20;
TRACK_UNPUBLISHED = 5;
TRACK_SUBSCRIBED = 6;
TRACK_SUBSCRIBE_REQUESTED = 21;
TRACK_SUBSCRIBE_FAILED = 25;
TRACK_UNSUBSCRIBED = 7;
TRACK_PUBLISHED_UPDATE = 10;
TRACK_MUTED = 23;
TRACK_UNMUTED = 24;
TRACK_PUBLISH_STATS = 26;
TRACK_SUBSCRIBE_STATS = 27;
PARTICIPANT_ACTIVE = 11;
PARTICIPANT_RESUMED = 22;
EGRESS_STARTED = 12;
EGRESS_ENDED = 13;
EGRESS_UPDATED = 28;
TRACK_MAX_SUBSCRIBED_VIDEO_QUALITY = 14;
RECONNECTED = 15;
INGRESS_CREATED = 18;
INGRESS_DELETED = 19;
INGRESS_STARTED = 16;
INGRESS_ENDED = 17;
INGRESS_UPDATED = 29;
// NEXT_ID: 30
}
message AnalyticsClientMeta {
string region = 1;
string node = 2;
string client_addr = 3;
uint32 client_connect_time = 4;
// udp, tcp, turn
string connection_type = 5;
ReconnectReason reconnect_reason = 6;
}
message AnalyticsEvent {
AnalyticsEventType type = 1;
google.protobuf.Timestamp timestamp = 2;
string room_id = 3;
Room room = 4;
string participant_id = 5;
ParticipantInfo participant = 6;
string track_id = 7;
TrackInfo track = 8;
string analytics_key = 10;
ClientInfo client_info = 11;
AnalyticsClientMeta client_meta = 12;
string egress_id = 13;
string ingress_id = 19;
VideoQuality max_subscribed_video_quality = 14;
ParticipantInfo publisher = 15;
string mime = 16;
EgressInfo egress = 17;
IngressInfo ingress = 18;
string error = 20;
RTPStats rtp_stats = 21;
int32 video_layer = 22;
// NEXT_ID: 23
}
message AnalyticsEvents {
repeated AnalyticsEvent events = 1;
}