Skip to content

Commit

Permalink
feat(config): Also configure how often to log.
Browse files Browse the repository at this point in the history
  • Loading branch information
bgrozev committed Jun 4, 2024
1 parent fcea8cf commit eaed5db
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 2 additions & 0 deletions jitsi-media-transform/src/main/resources/reference.conf
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,8 @@ jmt {
packet-timeline {
// Whether to enable the packet timeline. This is an expensive option used for debugging.
enabled = false
// Log a packet timeline for every one out of [log-fraction] packets.
log-fraction = 10000
}
payload-verification {
// Whether to enable payload verification on startup. This is a very expensive option only used for debugging.
Expand Down
6 changes: 4 additions & 2 deletions jvb/src/main/kotlin/org/jitsi/videobridge/Endpoint.kt
Original file line number Diff line number Diff line change
Expand Up @@ -1176,9 +1176,11 @@ class Endpoint @JvmOverloads constructor(
private val epTimeout = 2.mins

private val timelineCounter = AtomicLong()
private val TIMELINE_FRACTION = 10000L
private val timelineFraction: Long by config {
"jmt.debug.packet-timeline.log-fraction".from(JitsiConfig.newConfig)
}

fun logTimeline() = timelineCounter.getAndIncrement() % TIMELINE_FRACTION == 0L
fun logTimeline() = timelineCounter.getAndIncrement() % timelineFraction == 0L

private const val SRTP_QUEUE_ENTRY_EVENT = "Entered Endpoint SRTP sender outgoing queue"
private const val SRTP_QUEUE_EXIT_EVENT = "Exited Endpoint SRTP sender outgoing queue"
Expand Down

0 comments on commit eaed5db

Please sign in to comment.