It should be provided by the environment, just like on web. This avoids bundling
callstats on web, where it won't be used (we dynamically download it).
This reduces the bundle size from about 1MB to 675KB, almost 40%.
* wip: initial version of the new AnalyticsAdapter.
* ref: Restructures the ICE duration and state change events.
* ref: Restructures the JitsiLocalTrack events.
* ref: Restructures the TTFM events.
* ref: Updates the user feedback event.
* ref: Restructures the _CONNECTION_TIMES_ and TTFM events.
* ref: Restructures the BRIDGE_DOWN and NO_DATA_FROM_SOURCE events.
* ref: Restructures the FOCUS_LEFT event.
* ref: Restructures the DATA_CHANNEL_OPEN event.
* ref: Removes the ICE_FAILED event (it is a duplicate of a state change event).
* ref: Restructures the device list events.
Uses one event per device, since the new format does not allow non-atomic attributes.
* fix: Does not obey "unmute" commands from the focus.
* ref: Restructures the "remotely muted" event.
* ref: Restructures the CONFERENCE_ERROR events.
* ref: Removes the CONNECTION_INTERRUPTED event
We can use ICE_STATE_CHANGED instead.
* ref: Renames isreconnect to isReconnect.
* ref: Removes the CONNECTION_RESTORED event. Use ICE state changes instead.
* ref: Restructures the p2p events.
* ref: Restructures the jingle events.
* ref: Restructures the RTP statistics event.
* ref: Restructures the CONNECTION_FAILED and DISCONNECTED events.
* ref: Restructures the getUserMedia analytics events.
* ref: Cleans up AnalyticsEvents and restructures some of the events.
* fix: Adds error logs to the analytics adapter.
* ref: Refactor Statistics.sendEventToAll
Renames to sendEventAndLog, supports the object-based API, uses the
function where appropriate.
* fix: Addresses PR feedback.
* fix: Addresses Lyubomir's feedback.
* ref: Remove unused functions, adds documentation.
* feat: Adds a Statistics.sendAnalytics shortcut.
* ref: Uses the conference name as the default containerId.
* fix: Adrdesses Lenny's feedback.
* fix: Addresses more feedback.
* fix: Uses 'operational' as the default event type.
* doc: Updates the documentation.
* fix: Fixes adding of permanent properties.
* ref: Uses consistent naming for events' attributes.
Uses "_" as a separator instead of camel case or ".".
* feat: Adds the conference name as a permanent property automatically.
* ref: Don't expose Setting.machineId.
* fix: Adds a "p2p" attribute to jingle events.
* ref: Uses "action" instead of "name".
* ref: Uses underscore in events' attribute names.
* ref: Logs a message to the logger/console
instead of callstats in sendAnalyticsAndLog().
Reports ssrc to callstats when screen sharing is started. (#657)
Adds rtc.LOCAL_TRACK_SSRC_UPDATED event to be emitted when ssrc is updated for a local track.
Fixes adding rtc listeners for CREATE_ANSWER_FAILED, CREATE_OFFER_FAILED, SET_LOCAL_DESCRIPTION_FAILED, SET_REMOTE_DESCRIPTION_FAILED.
ESLint 4.8.0 discovers a lot of error related to formatting. While I
tried to fix as many of them as possible, a portion of them actually go
against our coding style. In such a case, I've disabled the indent rule
which effectively leaves it as it was before ESLint 4.8.0.
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.
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