* feat: multiple, simultaneous RTP stats
Makes it possible to have remote RTP stats running for more than one
peerconnection at a time.
* feat(stats): report RTT all the time
Will report JVB RTT (and end to end) while in P2P mode and vice versa.
* fix(JitsiConferenceEvents): remove CONNECTION_STATS
CONNECTION_STATS event is no longer emitted.
* fix(AvgRTPStatsReported): users with no video
Do not include FPS == 0 in average remote FPS calculation. Report NaN
for local FPS when video muted or no video device. NaN will be reported
for avg remote FPS if no video is received.
* fix(AvgRTPStatsReported): reset total packet loss
* feat(AvgRTPStatsReported): report 'screen' FPS
Will report average FPS for screen videos separately from camera videos,
but only if available (camera video reports NaN FPS when not available).
* fix(AvgRTPStatsReported): end2endRTT
Needs to report JSON with value.
* feat(AVG RTP stats): separate audio and video bitrate
Will report average audio and video bitrates separately.
* doc(JitsiConference): try to improve comment
* fix(AvgRTPStatsReporter): remove confusing reset
There's no a clear reason for doing reset there.
* ref(AvgRTPStatsReporter): rename var
* feat(JSPC): ICE establishment time
Will report total ICE establishment time under
'ice.initiator.establishmentDuration' and
'ice.responder.establishmentDuration' ('p2p.' prefix added for P2P).
It's the amount of time between the time when either checking or
gathering started (whichever starts first) and when ICE entered
'connected' for the first time.
* fix(JSPC): simplify and rename event
* ref: store SSRCs as a number
Converts all the places where SSRCs where stored as string to use
numbers.
* doc(RTPStatsCollector): getNonNegativeStat
Fixes invalid description about returning NaN.
* ref(JitsiConf...EventManager): simplify for..of
* ref(JitsiRemoteTrack): throw TypeError
Will throw a TypeError when 'ssrc' is not a number.
* fix(RTPStatsCollector): invalid reference
* doc(RTPStatsCollector): getNonNegativeStat private
* ref(RTPStatsCollector): simplify for..of
* fix(SSRCs): check for negative value
Will not accept negative SSRCs, since those are supposed to be unsigned.
Average end to end RTT calculated as a sum of local RTT towards the JVB
and an average of towards JVB RTTs reported by other participants.
Will be reported under 'stat.avg.end2endrtt' analytics event name.
AvgRTPStatsReporter will calculate arithmetic means of 'n' samples
and submit the values to the analytics module. The 'n' value is
configurable through 'avgRtpStatsN' conference config option. When set
to non-positive value the AvgRTPStatsReporter will be disabled.
The following values are reported:
- average upload bitrate => 'stat.avg.bitrate.upload'
- average download bitrate => 'stat.avg.bitrate.download'
- average upload bandwidth => 'stat.avg.bandwidth.upload'
- average download bandwidth => 'stat.avg.bandwidth.download'
- average total packet loss => 'stat.avg.packetloss.total'
- average upload packet loss => 'stat.avg.packetloss.upload'
- average download packet loss => 'stat.avg.packetloss.download'
- average FPS for remote videos => 'stat.avg.framerate.remote'
- average FPS for local video => 'stat.avg.framerate.local'
- average connection quality as defined by
the ConnectionQuality module => 'stat.avg.cq'
If the conference runs in P2P mode 'p2p.' prefix will be added to
the event's name. Any pending calculations are wiped out on every switch
between P2P and JVB modes and samples have to be collected from
the start.
Will emit analytics events for ICE gathering and ICE checks duration,
separately for initiator/responder and p2p/jvb connections. Initiator
and responder have to be separated, because the flow and the values have
significant differences.
XMPPEvents.CONNECTION_ESTABLISHED is emitted outside of 'is stable'
condition, because for the JVB connection the signalling state is often
not in 'stable' ('have-remote-offer') state when ICE goes to
'connected'.
ref(sdp): Do not add recvonly SSRC for muted video tracks.
Currently, when a participant joins hidden/video muted, we add a
recvonly SSRC so that the client sends RTCP reports with that SSRC. This
SSRC doesn't have neither simulcast nor RTX enabled. When the user
decides to enable his video camera, we "enhance" this SSRC with params
for RTX and simulcast. However, Chrome does not take into account these
new params because of
https://bugs.chromium.org/p/webrtc/issues/detail?id=7555. By not adding
a recvonly SSRC, we activate the default behavior in Chrome which is to
send RTCP reports with SSRC 1. So, when the user decides to enable his
video camera, instead of updating/enhancing the existing SSRC, we
initalize the primary SSRC with the correct params.
fix(stats): lazy initialization for statistics Sets
Internet Explorer is throwing an error when doing a for...of over
Sets. This is because IE needs a Set polyfill, which may be applied
after lib-jitsi-meet has loaded. However, lib-jitsi-meet on load
creates two Sets, one for CallStats.fabrics and another for
Statistics.instances. When the polyfill is then applied, the two
existing Sets do not get new methods. The fix is to lazily
initialize the Sets to allow for polyfills to be applied.
fix: ensure container is defined while attaching a track
For muted tracks, it is possible for undefined to get pushed
into the track's internal containers reference. The fix is
to immediately set the internal container variable in .attach()
to the passed in container value.
Sending the bare jid, speeds call setup as otherwise jigasi needs to do a feature discovery finding the conference component address and use it to construct the room address to join.
Splits the participant connection status detection logic into two
separate flows one for P2P and one for JVB.
Fixes problem where user outside of last N would be reported as INACTIVE
when in P2P mode.
Added some improvements to the detection logic by adding more priority
for the video tracks frozen detection (if supported) over the last N.
When the browser supports this detection and it's playing video we
should not check the last N, because it's less reliable.
Will emit BEFORE_STATISTICS_DISPOSED event, before the last CallStats
fabric is terminated to make sure that the final logs batch is reported
correctly.
Also adds a check for CallStats instance to queue events when
the backend has been initialized, but there is no CallStats instance
available to report on.
* ref(CallStats): cleanup constructor
Changes CallStats constructor to not take the whole JingleSessionPC as
it only needs an alias and the TraceablePeerConnection instance.
Describes the arguments in JSDoc.
* ref(CallStats): rename var
Everything is callstats c'mon...
* ref(CallStats): remove _checkInitialize
The _checkInitialize was trying to workaround CallStats lib issue
without really checking for any specific type of error on whether or not
it makes sense to retry.
Also it depended on some internal fields of 'callStatsBackend' and was
binding 'initCallback' to the backend instead of CallStats instance
which made no sense (it means it's very likely this functionality was
broken anyway).
It would be hard to fix it in a clean way, because CallStats instance
fields would have to be stored in static variables in order to make
the initCallback work (called from '_checkInitialize').
We also need to have more than one CallStats instance running at the
same time, because of the P2P which makes things even more complex.
* fix(CallStats): do not catch 'sendApplicationLog'
Wrapping 'sendApplicationLog' in 'tryCatch' will result in an endless
loop, because it will be logged on the logger.error which then tries
to send the logs immediately again.
* ref(CallStats): do not use call on static
There's nothing more confusing that seeing 'this' in a static method.
Wow maybe these methods are not really static !?
* ref(stats): fix var name
* feat(stats): report P2P to CallStats
Will create new CallStats fabric for the P2P peerconnection in order to
log peer to peer connections.
Refactoring was required in the statistics and CallStats module to be
able to have more than one CallStats instance. Because each CallStats
fabric reports one peer connection now each CallStats will correspond to
one TraceablePeerConnection. CallStats instances are now stored in a Map
mapped by the TraceablePeerConnection.id field.
In order to be able to execute some global/static CallStats reporting
methods all Statistics instances also need to be stored in a static
field.
CallStats API backend(new callstats()) will be initialized only once for
the values provided in the first call to initializeBackend. It is not
possible to have more that one CallStats backend running at the same
time (at the time of this writing). If we would have a routine for
disposing global "Statistics" module we could try to cleanup static
reference and allow to initialize it with new values (but no such use
case yet).
* ref(CallStats): move initCallback
Since there is no alphabetic order preserved in this file anyway at
least place it closer to it's usage.
* ref(CallStats): remove tryCatch
Temporarily removes tryCatch to make the ES6 conversion easier.
* ref(CallStats): convert to ES6
* style(CallStats): fix indentation
* fix(statistics): use import for CallStats
* ref(CallStats): convert static methods
Some of the methods should not be static, because it only make sense
to call it when there is CallStats instance available.
* ref(CallStats): rename var
* doc(CallStats): remove misplaced comment
* chore(CallStats): remove invalid eslint comment
* fix(CallStats): undefined CallStats namespace
If no CallStats ID namespace option is provided the conference will be
reported without it.
* style(stats|CallStats): remove extra lines
* fix(CallStats): do not log error from tryCatch
GlobalOnErrorHandler calls logger.error anyway.
* fix(CallStats): cleanup tryCatch
If I understand correctly our initial intention with doing tryCatch was
to avoid crashing the whole app in case the CallStats backend would
crash. With this commit the tryCatch is done by wrapping original
backend instance methods or using explicit try catch block where
the method is called only from one place or a value needs to be returned
in case of a crash.
* ref(CallStats): make backend a static var
* fix(CallStats): invalid eslint comments
* ref(CallStats): use for..of
* ref(CallStats): fixes around REST args
* ref(CallStats): rename var
* ref(CallStats): reorder static methods
Also renamed some callbacks
* doc(CallStats): adds some docs
* ref(CallStats): make methods not static
Both 'sendDominantSpeakerEvent' and 'sendScreenSharingEvent' methods are
not really static as they require instance to be called.
* fix(CallStats): invalid key
* fix(CallStats): reduce amount of debug logs
* feat(p2p|CallStats): log hold/resume
Will put CallStats fabric for the JVB connection "on hold" while in p2p
mode.
* doc(CallStats): add FIXME
* doc(JitsiConference,CallStats): typos and renaming