mirror of https://github.com/OpenVidu/openvidu.git
openvidu-server: KMS methods to get the number of sessions and webrtc connections
parent
ff35adf607
commit
fe03ee96ce
|
@ -345,4 +345,9 @@ public class KurentoSession extends Session {
|
||||||
return json;
|
return json;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getNumberOfWebrtcConnections() {
|
||||||
|
return this.getActivePublishers() + this.participants.values().stream()
|
||||||
|
.mapToInt(p -> ((KurentoParticipant) p).getSubscribers().size()).reduce(0, Integer::sum);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -250,4 +250,9 @@ public class Kms {
|
||||||
return this.uri;
|
return this.uri;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getNumberOfWebrtcConnections() {
|
||||||
|
return this.kurentoSessions.values().stream().mapToInt(session -> session.getNumberOfWebrtcConnections())
|
||||||
|
.reduce(0, Integer::sum);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue