Skip to content

Commit

Permalink
feat: Add jigasi region to debug output
Browse files Browse the repository at this point in the history
  • Loading branch information
bgrozev committed Nov 12, 2024
1 parent 3a92e17 commit 896f4b4
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ open class JigasiDetector(
this["supports_transcription"] = instance.supportsTranscription()
this["is_in_graceful_shutdown"] = instance.isInGracefulShutdown()
this["participants"] = instance.getParticipantCount()
this["region"] = instance.getRegion() ?: "null"
}
debugState[instance.jid.resourceOrEmpty.toString()] = instanceJson
}
Expand Down Expand Up @@ -148,8 +149,10 @@ private fun BaseBrewery<ColibriStatsExtension>.BrewInstance.supportsTranscriptio
private fun BaseBrewery<ColibriStatsExtension>.BrewInstance.supportsSip(): Boolean =
java.lang.Boolean.parseBoolean(status.getValueAsString(ColibriStatsExtension.SUPPORTS_SIP))
private fun BaseBrewery<ColibriStatsExtension>.BrewInstance.isInRegion(vararg regions: String?): Boolean =
regions.contains(status.getValueAsString(ColibriStatsExtension.REGION))
regions.contains(this.getRegion())
private fun BaseBrewery<ColibriStatsExtension>.BrewInstance.getParticipantCount(): Int =
status.getValueAsInt(ColibriStatsExtension.PARTICIPANTS) ?: 0
private fun BaseBrewery<ColibriStatsExtension>.BrewInstance.getRegion(): String? =
status.getValueAsString(ColibriStatsExtension.REGION)
private fun List<BaseBrewery<ColibriStatsExtension>.BrewInstance>.leastLoaded() =
minByOrNull { it.getParticipantCount() }

0 comments on commit 896f4b4

Please sign in to comment.