mirror of
https://github.com/strukturag/nextcloud-spreed-signaling
synced 2024-06-05 07:22:15 +02:00
Only log RTT of connections to proxy if larger than 500ms.
This commit is contained in:
parent
31294aee1d
commit
42dc476033
|
@ -66,6 +66,8 @@ const (
|
||||||
maxWaitDelay = 8 * time.Second
|
maxWaitDelay = 8 * time.Second
|
||||||
|
|
||||||
defaultProxyTimeoutSeconds = 2
|
defaultProxyTimeoutSeconds = 2
|
||||||
|
|
||||||
|
rttLogDuration = 500 * time.Millisecond
|
||||||
)
|
)
|
||||||
|
|
||||||
type mcuProxyPubSubCommon struct {
|
type mcuProxyPubSubCommon struct {
|
||||||
|
@ -385,9 +387,11 @@ func (c *mcuProxyConnection) readPump() {
|
||||||
}
|
}
|
||||||
if ts, err := strconv.ParseInt(msg, 10, 64); err == nil {
|
if ts, err := strconv.ParseInt(msg, 10, 64); err == nil {
|
||||||
rtt := now.Sub(time.Unix(0, ts))
|
rtt := now.Sub(time.Unix(0, ts))
|
||||||
|
if rtt >= rttLogDuration {
|
||||||
rtt_ms := rtt.Nanoseconds() / time.Millisecond.Nanoseconds()
|
rtt_ms := rtt.Nanoseconds() / time.Millisecond.Nanoseconds()
|
||||||
log.Printf("Proxy at %s has RTT of %d ms (%s)", c.url, rtt_ms, rtt)
|
log.Printf("Proxy at %s has RTT of %d ms (%s)", c.url, rtt_ms, rtt)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return nil
|
return nil
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue