Skip to content

Commit

Permalink
feat: Add stats for number of conference requests. (#1121)
Browse files Browse the repository at this point in the history
  • Loading branch information
bgrozev authored Nov 14, 2023
1 parent 067e575 commit 8a5d4c9
Showing 1 changed file with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import org.jitsi.jicofo.FocusManager
import org.jitsi.jicofo.TaskPools
import org.jitsi.jicofo.auth.AuthenticationAuthority
import org.jitsi.jicofo.auth.ErrorFactory
import org.jitsi.jicofo.metrics.JicofoMetricsContainer
import org.jitsi.utils.OrderedJsonObject
import org.jitsi.utils.logging2.createLogger
import org.jitsi.xmpp.extensions.jitsimeet.ConferenceIq
Expand Down Expand Up @@ -83,8 +84,10 @@ class ConferenceIqHandler(
}

logger.info("Conference request for room $room, from ${query.from}")
conferenceRequestCounter.inc()
val conference = focusManager.getConference(room)
val roomExists = conference != null
if (!roomExists) newConferenceRequestCounter.inc()

// Authentication logic
val error: IQ? = processExtensions(query, room, response, roomExists)
Expand Down Expand Up @@ -209,4 +212,15 @@ class ConferenceIqHandler(
JidCreate.domainBareFrom(address)
}
}

companion object {
val conferenceRequestCounter = JicofoMetricsContainer.instance.registerCounter(
"conference_requests",
"Number of conference requests received."
)
val newConferenceRequestCounter = JicofoMetricsContainer.instance.registerCounter(
"conference_requests_new",
"Number of conference requests received for new conferences."
)
}
}

0 comments on commit 8a5d4c9

Please sign in to comment.