<commit_before>setInterval(() => {
    const xhttp = new XMLHttpRequest();
    xhttp.onreadystatechange = function () {
        if (this.readyState === 4 && this.status === 200) {
            const array = ['guilds', 'channels', 'users'];
            for (const value in array)
                document.getElementById(array[value]).innerHTML = JSON.parse(xhttp.responseText)[array[value]];
        }
    };
    xhttp.open('GET', '/api/stats', true);
    xhttp.send();
}, 10000);<commit_msg>Interval set to 2 seconds, now runs once at boot aswell<commit_after>updateValues();
setInterval(updateValues, 2000);

function updateValues () {
    const xhttp = new XMLHttpRequest();
    xhttp.onreadystatechange = function () {
        if (this.readyState === 4 && this.status === 200) {
            const stats = JSON.parse(xhttp.responseText);
            const array = Object.keys(stats);
            for (const value in array)
                document.getElementById(array[value]).innerHTML = stats[array[value]];
        }
    };
    xhttp.open('GET', '/api/stats', true);
    xhttp.send();
}
{'fraction_non_alphanumeric': 0.15137614678899083, 'fraction_numerical': 0.01651376146788991, 'mean_word_length': 2.7620689655172415, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5352646', 'n_tokens_mistral': 329, 'n_tokens_neox': 304, 'n_words': 71}