Skip to content

Commit

Permalink
Port totalConferencesCompleted stat to Metric. (#1931)
Browse files Browse the repository at this point in the history
* ref: Port totalConferencesCompleted stat to Metric.
* ref: Rename totalConferencesCreated variable and metric.
  • Loading branch information
alexcsf authored Aug 9, 2022
1 parent 915593c commit 42bc1b9
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
4 changes: 2 additions & 2 deletions jvb/src/main/java/org/jitsi/videobridge/Conference.java
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down Expand Up @@ -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());
Expand Down
8 changes: 5 additions & 3 deletions jvb/src/main/java/org/jitsi/videobridge/Videobridge.java
Original file line number Diff line number Diff line change
Expand Up @@ -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.");

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down

0 comments on commit 42bc1b9

Please sign in to comment.