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

Send data stats when using event handlers #3126

Merged
merged 1 commit into from
Dec 21, 2022
Merged

Send data stats when using event handlers #3126

merged 1 commit into from
Dec 21, 2022

Conversation

lminiero
Copy link
Member

@lminiero lminiero commented Dec 14, 2022

I was made aware that, when using event handlers, we send stats for all medium instances except the one used for data channels, so only audio and video. Considering we do expose info on received/sent DTLS data (in terms of packets and bytes) in the Admin API, I thought I'd use that to send stats for the datachannel medium instance too, when available. Of course, considering there's no RTCP involved, the event is much more barebones:

{
    "emitter": "MyJanusInstance",
    "type": 32,
    "subtype": 3,
    "timestamp": 1671040193161999,
    "session_id": 2405066358686740,
    "handle_id": 8068184951870531,
    "opaque_id": "echotest-qyUKcffvvvHR",
    "event": {
        "mid": "2",
        "mindex": 2,
        "media": "data",
        "packets-received": 9,
        "packets-sent": 7,
        "bytes-received": 1847,
        "bytes-sent": 1688
    }
}

That said, it should still be useful for monitoring purposes. It's worth pointing out that, if you have an event handler recipient, and you're doing validation on received payloads, you should now be prepared to receive events with type 32 that have less info, since we're not using it for audio and video alone.

Planning to merge soon: when that happens, I'll update 0.x with the same fix too.

Verified

This commit was signed with the committer’s verified signature.
LaurenWags Lauren
@lminiero lminiero added the multistream Related to Janus 1.x label Dec 14, 2022
@lminiero
Copy link
Member Author

Merging.

@lminiero lminiero merged commit 4dd1e9b into master Dec 21, 2022
@lminiero lminiero deleted the data-stats branch December 21, 2022 15:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
multistream Related to Janus 1.x
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant