<commit_before>/* global require */
var LocalStats = require("./LocalStatsCollector.js");
var logger = require("jitsi-meet-logger").getLogger(__filename);
var RTPStats = require("./RTPStatsCollector.js");
var EventEmitter = require("events");
var StatisticsEvents = require("../../service/statistics/Events");
var AnalyticsAdapter = require("./AnalyticsAdapter");
var CallStats = require("./CallStats");
var ScriptUtil = require('../util/ScriptUtil');
import JitsiTrackError from "../../JitsiTrackError";

/**
 * True if callstats API is loaded
 */
 var isCallstatsLoaded = false;

// Since callstats.io is a third party, we cannot guarantee the quality of their
// service. More specifically, their server may take noticeably long time to
// respond. Consequently, it is in our best interest (in the sense that the
// intergration of callstats.io is pretty important to us but not enough to
// allow it to prevent people from joining a conference) to (1) start
// downloading their API as soon as possible and (2) do the downloading
// asynchronously.
function loadCallStatsAPI(customScriptUrl) {
    if(!isCallstatsLoaded) {
        ScriptUtil.loadScript(
                customScriptUrl ? customScriptUrl :
                    'https://api.callstats.io/static/callstats.min.js',<commit_msg>Updates callstats link by default to use websockets.<commit_after>/* global require */
var LocalStats = require("./LocalStatsCollector.js");
var logger = require("jitsi-meet-logger").getLogger(__filename);
var RTPStats = require("./RTPStatsCollector.js");
var EventEmitter = require("events");
var StatisticsEvents = require("../../service/statistics/Events");
var AnalyticsAdapter = require("./AnalyticsAdapter");
var CallStats = require("./CallStats");
var ScriptUtil = require('../util/ScriptUtil');
import JitsiTrackError from "../../JitsiTrackError";

/**
 * True if callstats API is loaded
 */
 var isCallstatsLoaded = false;

// Since callstats.io is a third party, we cannot guarantee the quality of their
// service. More specifically, their server may take noticeably long time to
// respond. Consequently, it is in our best interest (in the sense that the
// intergration of callstats.io is pretty important to us but not enough to
// allow it to prevent people from joining a conference) to (1) start
// downloading their API as soon as possible and (2) do the downloading
// asynchronously.
function loadCallStatsAPI(customScriptUrl) {
    if(!isCallstatsLoaded) {
        ScriptUtil.loadScript(
                customScriptUrl ? customScriptUrl :
                    'https://api.callstats.io/static/callstats-ws.min.js',
{'fraction_non_alphanumeric': 0.11491628614916286, 'fraction_numerical': 0.0015220700152207, 'mean_word_length': 3.960377358490566, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5878247', 'n_tokens_mistral': 695, 'n_tokens_neox': 682, 'n_words': 250}