You've already forked matrix-js-sdk
mirror of
https://github.com/matrix-org/matrix-js-sdk.git
synced 2025-07-30 04:23:07 +03:00
Make webrtc stats collection optional (#3307)
* stats: disable stats collection if interval zero * stats: add groupcall property for stats interval * stats: disable collecting webrtc stats by default * add setup methode for group call stats * suppress lint errors in test
This commit is contained in:
@ -68,7 +68,7 @@ describe("GroupCallStats", () => {
|
||||
jest.useRealTimers();
|
||||
});
|
||||
|
||||
it("starting processing as well without stats collectors", async () => {
|
||||
it("starting processing stats as well without stats collectors", async () => {
|
||||
// @ts-ignore
|
||||
stats.processStats = jest.fn();
|
||||
stats.start();
|
||||
@ -77,6 +77,16 @@ describe("GroupCallStats", () => {
|
||||
expect(stats.processStats).toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it("not starting processing stats if interval 0", async () => {
|
||||
const statsDisabled = new GroupCallStats(GROUP_CALL_ID, LOCAL_USER_ID, 0);
|
||||
// @ts-ignore
|
||||
statsDisabled.processStats = jest.fn();
|
||||
statsDisabled.start();
|
||||
jest.advanceTimersByTime(TIME_INTERVAL);
|
||||
// @ts-ignore
|
||||
expect(statsDisabled.processStats).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it("starting processing and calling the collectors", async () => {
|
||||
stats.addStatsReportGatherer("CALL_ID", "USER_ID", mockRTCPeerConnection());
|
||||
const collector = stats.getStatsReportGatherer("CALL_ID");
|
||||
|
Reference in New Issue
Block a user