From 42bc1b9986b375e4e9d5044585f6bd0604bf8d25 Mon Sep 17 00:00:00 2001 From: Alexandre <4717855+alexcsf@users.noreply.github.com> Date: Tue, 9 Aug 2022 14:51:46 +0100 Subject: [PATCH] Port totalConferencesCompleted stat to Metric. (#1931) * ref: Port totalConferencesCompleted stat to Metric. * ref: Rename totalConferencesCreated variable and metric. --- jvb/src/main/java/org/jitsi/videobridge/Conference.java | 4 ++-- jvb/src/main/java/org/jitsi/videobridge/Videobridge.java | 8 +++++--- .../jitsi/videobridge/stats/VideobridgeStatistics.java | 4 ++-- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/jvb/src/main/java/org/jitsi/videobridge/Conference.java b/jvb/src/main/java/org/jitsi/videobridge/Conference.java index d2f0b31fea..d4ac78318e 100644 --- a/jvb/src/main/java/org/jitsi/videobridge/Conference.java +++ b/jvb/src/main/java/org/jitsi/videobridge/Conference.java @@ -294,7 +294,7 @@ else if (requestIQ instanceof ConferenceModifyIQ) }, 3, 3, TimeUnit.SECONDS); Videobridge.Statistics videobridgeStatistics = videobridge.getStatistics(); - videobridgeStatistics.totalConferencesCreated.inc(); + videobridgeStatistics.conferencesCreated.inc(); epConnectionStatusMonitor = new EndpointConnectionStatusMonitor(this, TaskPools.SCHEDULED_POOL, logger); epConnectionStatusMonitor.start(); } @@ -640,7 +640,7 @@ private void updateStatisticsOnExpire() Videobridge.Statistics videobridgeStatistics = getVideobridge().getStatistics(); - videobridgeStatistics.totalConferencesCompleted.incrementAndGet(); + videobridgeStatistics.conferencesCompleted.incAndGet(); videobridgeStatistics.totalConferenceSeconds.addAndGet(durationSeconds); videobridgeStatistics.totalBytesReceived.addAndGet(statistics.totalBytesReceived.get()); diff --git a/jvb/src/main/java/org/jitsi/videobridge/Videobridge.java b/jvb/src/main/java/org/jitsi/videobridge/Videobridge.java index eefca1503a..d23c957400 100644 --- a/jvb/src/main/java/org/jitsi/videobridge/Videobridge.java +++ b/jvb/src/main/java/org/jitsi/videobridge/Videobridge.java @@ -962,14 +962,16 @@ public static class Statistics * The cumulative/total number of conferences completed/expired on this * {@link Videobridge}. */ - public AtomicInteger totalConferencesCompleted = new AtomicInteger(0); + public CounterMetric conferencesCompleted = VideobridgeMetricsContainer.getInstance().registerCounter( + "conferences_completed", + "The total number of conferences completed/expired on the Videobridge."); /** * The cumulative/total number of conferences created on this * {@link Videobridge}. */ - public CounterMetric totalConferencesCreated = VideobridgeMetricsContainer.getInstance().registerCounter( - "created_conferences", + public CounterMetric conferencesCreated = VideobridgeMetricsContainer.getInstance().registerCounter( + "conferences_created", "The total number of conferences created on the Videobridge."); /** diff --git a/jvb/src/main/java/org/jitsi/videobridge/stats/VideobridgeStatistics.java b/jvb/src/main/java/org/jitsi/videobridge/stats/VideobridgeStatistics.java index 84302d33b0..c4f665b0a3 100644 --- a/jvb/src/main/java/org/jitsi/videobridge/stats/VideobridgeStatistics.java +++ b/jvb/src/main/java/org/jitsi/videobridge/stats/VideobridgeStatistics.java @@ -495,10 +495,10 @@ private void generate0() jvbStats.partiallyFailedConferences.get()); unlockedSetStat( TOTAL_CONFERENCES_CREATED, - jvbStats.totalConferencesCreated.get()); + jvbStats.conferencesCreated.get()); unlockedSetStat( TOTAL_CONFERENCES_COMPLETED, - jvbStats.totalConferencesCompleted.get()); + jvbStats.conferencesCompleted.get()); unlockedSetStat( TOTAL_ICE_FAILED, jvbStats.totalIceFailed.get());