Skip to content

Commit 0a5c16f

Browse files
authored
Port more metrics to MetricsContainer (#973)
* ref: Move FocusManager to kotlin. * ref: Move Statistics to ConferenceMetrics. * ref: Adjust variable names. * ref: Adjust MetricsContainer metric names. * Port more metrics to MetricsContainer. * ref: Extract a function to update metrics. * Remove jibri "pending" stats. * ref: Move jibri metrics to MetricsContainer. * fix: Return bad_request if "room" is missing, make param non-nullable.
1 parent 722dd82 commit 0a5c16f

10 files changed

Lines changed: 563 additions & 820 deletions

File tree

jicofo/src/main/java/org/jitsi/jicofo/FocusManager.java

Lines changed: 0 additions & 688 deletions
This file was deleted.

jicofo/src/main/java/org/jitsi/jicofo/conference/JitsiMeetConferenceImpl.java

Lines changed: 6 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
import org.jitsi.jicofo.bridge.colibri.*;
2626
import org.jitsi.jicofo.conference.source.*;
2727
import org.jitsi.jicofo.lipsynchack.*;
28-
import org.jitsi.jicofo.stats.*;
2928
import org.jitsi.jicofo.version.*;
3029
import org.jitsi.jicofo.xmpp.*;
3130
import org.jitsi.jicofo.xmpp.UtilKt;
@@ -678,14 +677,14 @@ private void inviteChatMember(ChatRoomMember chatRoomMember, boolean justJoined)
678677
List<String> features = getClientXmppProvider().discoverFeatures(chatRoomMember.getOccupantJid());
679678
final Participant participant = new Participant(chatRoomMember, features, logger, this);
680679

681-
Statistics.totalParticipants.inc();
680+
ConferenceMetrics.participants.inc();
682681
if (!participant.supportsReceivingMultipleVideoStreams())
683682
{
684-
Statistics.totalParticipantsNoMultiStream.inc();
683+
ConferenceMetrics.participantsNoMultiStream.inc();
685684
}
686685
if (!participant.hasSourceNameSupport())
687686
{
688-
Statistics.totalParticipantsNoSourceName.inc();
687+
ConferenceMetrics.participantsNoSourceName.inc();
689688
}
690689

691690
participants.put(chatRoomMember.getOccupantJid(), participant);
@@ -778,23 +777,6 @@ private boolean checkMinParticipants()
778777
return chatRoom != null && chatRoom.getMembersCount() >= minParticipants;
779778
}
780779

781-
/**
782-
* Destroys the MUC room and deletes the conference which results in all
783-
* participant being removed from the XMPP chat room.
784-
* @param reason the reason text that will be advertised to all
785-
* participants upon exit.
786-
*/
787-
public void destroy(String reason)
788-
{
789-
if (chatRoom == null)
790-
{
791-
logger.error("Unable to destroy conference MUC room, not joined");
792-
return;
793-
}
794-
795-
chatRoom.destroy(reason, null);
796-
}
797-
798780
/**
799781
* Expires all COLIBRI conferences.
800782
*/
@@ -1019,7 +1001,7 @@ public StanzaError onSessionInfo(@NotNull JingleSession session, JingleIQ iq)
10191001
address,
10201002
bridgeSessionId));
10211003
}
1022-
Statistics.totalParticipantsIceFailed.inc();
1004+
ConferenceMetrics.participantsIceFailed.inc();
10231005

10241006
return null;
10251007
}
@@ -1054,7 +1036,7 @@ public StanzaError onSessionTerminate(@NotNull JingleSession session, JingleIQ i
10541036

10551037
if (restartRequested)
10561038
{
1057-
Statistics.totalParticipantsRequestedRestart.inc();
1039+
ConferenceMetrics.participantsRequestedRestart.inc();
10581040
}
10591041

10601042
if (!Objects.equals(bridgeSessionId, existingBridgeSessionId))
@@ -1697,7 +1679,7 @@ private void reInviteParticipantsById(@NotNull List<String> participantIdsToRein
16971679
{
16981680
if (!participantIdsToReinvite.isEmpty())
16991681
{
1700-
Statistics.totalParticipantsMoved.addAndGet(participantIdsToReinvite.size());
1682+
ConferenceMetrics.participantsMoved.addAndGet(participantIdsToReinvite.size());
17011683
synchronized (participantLock)
17021684
{
17031685
List<Participant> participantsToReinvite = new ArrayList<>();

jicofo/src/main/java/org/jitsi/jicofo/rest/Pin.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public class Pin
4343
@Produces(MediaType.APPLICATION_JSON)
4444
public String getPins()
4545
{
46-
return jicofoServices.getFocusManager().getPinnedConferences().toJSONString();
46+
return jicofoServices.getFocusManager().getPinnedConferencesJson().toJSONString();
4747
}
4848

4949
@POST

jicofo/src/main/java/org/jitsi/jicofo/stats/Statistics.java

Lines changed: 0 additions & 66 deletions
This file was deleted.

0 commit comments

Comments
 (0)