Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Client report #385

Open
wants to merge 23 commits into
base: main
Choose a base branch
from
Open

Client report #385

wants to merge 23 commits into from

Conversation

lukasIO
Copy link
Contributor

@lukasIO lukasIO commented May 22, 2023

No description provided.

livekit_models.proto Show resolved Hide resolved
livekit_models.proto Show resolved Hide resolved

message RTCSenderStats {
// none, cpu, bandwidth, or other
string qualityLimitationReason = 1;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think quality limitation might be more useful to keep track as events.. since there's a clear start & finish point (and a clear cause). The webrtc-internals display is only reflecting current state, so sending it as a stat would require us to send the entire payload whenever that field is detected to have changed.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we have qualitylimitationDurations directly from the stats, without dedicated events and only reading from stats, I guess that's the best we can do for now. We'll have the current limitation reason regularly whenever we send a report.

}

message RTCReceiverStats {
int32 jitter = 1;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this looking at total jitter?

Copy link
Contributor Author

@lukasIO lukasIO Jul 18, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it was meant as a snapshot. but maybe makes sense to sample multiple values over time until the next report gets sent out?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's total jitter as defined here

livekit_models.proto Outdated Show resolved Hide resolved
}

message DeviceInfo {
string ua = 1;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ua is already captured by the server during the initial session establishment (even though we only store a parsed version of it). since concurrency is unlikely to change, could that also be passed up at the same time?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

makes sense.
thinking more about this, it seems to me like DeviceInfo would also conceptually be a one-off message as it won't change over time. Even if we include other properties here, those will be hardware bound, so adding them one time when connection establishes probably makes the most sense.
Do you agree to remove this entirely from here and rather add concurrency to the already existing ClientInfo?

livekit_models.proto Outdated Show resolved Hide resolved
@lukasIO lukasIO marked this pull request as ready for review August 4, 2023 14:50
@lukasIO lukasIO requested a review from davidzhao August 4, 2023 14:50

message RTCAudioReceiverStats {
RTCReceiverStats common_stats = 1;
uint32 concealed_samples = 2;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we'll also need total_samples for concealed samples to be useful.

message RTCVideoSenderStats {
RTCSenderStats common_stats = 1;
// outbound-rtp
map<string, uint32> quality_limitation_durations = 2;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if webrtc-internals tracks this differently between layers. for some reasons I remember the duration being the same across layers.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is RTCVideoSenderStats per track? or per simulcast layer?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's per sender, which should be equivalent to per track.
I think you're right, that it will not track different layers, but how would we do that in the first place?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Regarding the type, it's a map that includes reason and duration and not different layers.

// local-candidate
string networkType = 3;
// outbound-rtp
uint64 packetsSent = 4;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would suggest snake_case for field names.

though I'm not sure if network level stats would be helpful, since we do get these on the server side. For v1, let's start with minimal stats?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missed snake case here. Will remove packets_sent entirely then.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would you also want to exclude nack_count for now as we see that on the server, too?

enum SubscriptionError {
SE_UNKNOWN = 0;
SE_CODEC_UNSUPPORTED = 1;
SE_TRACK_NOTFOUND = 2;
}

message ClientReport {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

perhaps we should move this outside of livekit_models? since it's used by a very specific request.. maybe into RoomService?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will move it to RoomService as a last step, so that keeping track of the discussions is easier until then


message RTCSenderStats {
// ice-candidate-pair
uint32 available_outgoing_bitrate = 1;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this seems like at the transport layer, and doesn't fit too well within each sender

Copy link
Contributor Author

@lukasIO lukasIO Aug 7, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

makes sense, is your suggestion to leave it out entirely or to move it to a higher level, that's not sender related?

string quality_limitation_reason = 3;
uint32 quality_limitation_resolution_changes = 4;
string scalability_mode = 5;
uint32 frame_height = 6;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

which layer would dimension stats be referencing? I think we also already have these pieces of data on the server side.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the original dimension. Makes sense to omit them, if we have them already.

message VideoPublicationReport {
string sid = 1;
RTCVideoSenderStats rtc_stats = 2;
int32 ready_state = 3;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

trying to understand these a bit:

  • ready_state - I think this is just live or ended. do we expect to be ended?
  • label - this seems a better fit as an event, since we do not expect this to change?
  • muted - is this tracking MediaStreamTrack.muted property ? i.e. has data, or is it looking at our mute property? would be good to use a diff name here if it's former.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. we don't expect it to be ended, but it might be good debugging insight to know that for sure?
  2. not sure why I wanted to include this in the first place, I guess we can drop it for v1 at least
  3. it's looking at our mute property.

int32 ready_state = 3;
SubscriptionStatus subscription_status = 4;
bool allowed = 5;
uint32 width = 6;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should move into RTCVideoReceiverStats ? since the width and height of receiver can change dynamically.

though I'm also not sure what value it is to keep this on the client.. since the server knows exactly what width/height is sent down

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you're right, we would have dimension in RTC stats as well. Seems like leaving them out is the way to go!

message VideoSubscriptionReport {
string sid = 1;
RTCVideoReceiverStats rtc_stats = 2;
int32 ready_state = 3;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same question as above

uint32 packetsLost = 5;
uint32 nack_count = 6;
uint32 retransmitted_packets_sent = 7;
uint64 timestamp = 8;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

which timestamp is this referencing? I only noticed it in the sender stats.. do we need a similar timestamp in the receiver side too? maybe this should be moved into the *Report message itself?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

timestamp is referring to

A DOMHighResTimeStamp object indicating the time at which the sample was taken for this statistics object.

For receiver stats I included last_packet_received_timestamp, but probably makes sense to add the processing timestamp, too!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants