Skip to content

Room stats API#138

Merged
alan-george-lk merged 14 commits into
mainfrom
feature/stats
May 29, 2026
Merged

Room stats API#138
alan-george-lk merged 14 commits into
mainfrom
feature/stats

Conversation

@alan-george-lk
Copy link
Copy Markdown
Collaborator

@alan-george-lk alan-george-lk commented May 20, 2026

This PR exposes a getStats() public API method to room.h to match Rust.

API design decisions

TL/DR: matches Rust SDK as 1:1 as possible.

I opted for the signature getStats() to match Rust: https://github.com/livekit/rust-sdks/blob/1848e77a32ca2f302a58323a7a21858165d81aad/livekit/src/room/mod.rs#L831

std::future -> async equivalent

The struct SessionStats also matches Rust: https://github.com/livekit/rust-sdks/blob/1848e77a32ca2f302a58323a7a21858165d81aad/livekit/src/rtc_engine/rtc_session.rs#L112

Stores vectors of publisher_stats and subscriber_stats to match Rust.

Error handling

  • I opted to match the existing Track::getStats() which throws an exception

Testing

  • Added unit test that checks the error path
  • Added integration test that does some basic room operations and then obtains the stats

@alan-george-lk alan-george-lk changed the title Expose room session stats Room stats API May 22, 2026
@alan-george-lk alan-george-lk marked this pull request as ready for review May 26, 2026 21:53
Copy link
Copy Markdown
Collaborator

@stephen-derosa stephen-derosa left a comment

Choose a reason for hiding this comment

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

nice LGTM!

Comment thread src/room.cpp Outdated
@alan-george-lk alan-george-lk merged commit 069b78d into main May 29, 2026
24 checks passed
@alan-george-lk alan-george-lk deleted the feature/stats branch May 29, 2026 00:33
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