<commit_before>(function() {
    'use strict';

    var chart = Morris.Line({
        element: 'speedtest-chart',
        data: [],
        xkey: 'dateTime',
        ykeys: ['ping', 'download', 'upload'],
        labels: ['Ping [ms]', 'Down [Mbit/s]', 'Up [Mbit/s]'],
        lineColors: ['rgb(110, 110, 245)', 'rgb(234, 27, 19)', 'rgb(230, 100, 19)'],
        pointSize: 0,
        smooth: false,
        resize: true,
        continuousLine: true
    });

    function round(number, decimalPlaces) {
        decimalPlaces = decimalPlaces ? decimalPlaces : 0;
        var factor = Math.pow(10, decimalPlaces);
        return Math.round(number * factor) / factor;
    }

    function refresh() {
        $.ajax({
            type: 'GET',
            cache: false,
            url: 'log.php'
        }).done(function(log) {
            if (log.length === 0)
                alert('There are no log entries yet.');
            var chartData = [];
            for (var i = 0; i < log.length; i++) {
                chartData.push({
                    dateTime: log[i][0],
                    ping:     round(log[i][1], 0),
                    download: round(log[i][2], 1),
                    upload:   round(log[i][3], 1)
                });
            }
            chart.setData(chartData);
        }).fail(function() {
            alert('Log data could not be fetched :(');
        });
    }

    $(function () {
        $(window).focus(function() {
            refresh()<commit_msg>Cap PING at 75 ms<commit_after>(function() {
    'use strict';

    var chart = Morris.Line({
        element: 'speedtest-chart',
        data: [],
        xkey: 'dateTime',
        ykeys: ['ping', 'download', 'upload'],
        labels: ['Ping [ms]', 'Down [Mbit/s]', 'Up [Mbit/s]'],
        lineColors: ['rgb(110, 110, 245)', 'rgb(234, 27, 19)', 'rgb(230, 100, 19)'],
        pointSize: 0,
        smooth: false,
        resize: true,
        continuousLine: true
    });

    function round(number, decimalPlaces) {
        decimalPlaces = decimalPlaces ? decimalPlaces : 0;
        var factor = Math.pow(10, decimalPlaces);
        return Math.round(number * factor) / factor;
    }

    function refresh() {
        $.ajax({
            type: 'GET',
            cache: false,
            url: 'log.php'
        }).done(function(log) {
            if (log.length === 0)
                alert('There are no log entries yet.');
            var chartData = [];
            for (var i = 0; i < log.length; i++) {
                chartData.push({
                    dateTime: log[i][0],
                    ping:     round(Math.min(75, log[i][1]), 0),
                    download: round(log[i][2], 1),
                    upload:   round(log[i][3], 1)
                });
            }
            chart.setData(chartData);
        }).fail(function() {
            alert('Log data could not be fetched :(');
        });
    }

    $(function () {
        $(window).focus(function() {
            refresh()
{'fraction_non_alphanumeric': 0.16176470588235295, 'fraction_numerical': 0.02606951871657754, 'mean_word_length': 1.5429056924384028, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, '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': '6968046', 'n_tokens_mistral': 957, 'n_tokens_neox': 875, 'n_words': 216}