<commit_before>define([
    "_"
    , "backbone"
], function(
    _
    , Backbone
) {
    return Backbone.Model.extend({
        defaults: {
            // current connections
            conn_current: 0

            // Connection Stats
            , conn_attempted : 0
            , conn_ok        : 0
            , conn_fail      : 0
            , conn_rate      : 100

            // lifetime measurements
            , conn_lt_5s: 0
            , conn_lt_15s: 0
            , conn_lt_30s: 0
            , conn_lt_60s: 0
            , conn_lt_120s: 0
            , conn_lt_max: 0

            // Ping Stats
            , ping_sent     : 0
            , ping_received : 0
            , ping_timeout  : 0
            , ping_rate     : 12
            , ping_avg      : 0
            , ping_median   : 0
        }

        , initialize: function(options) {

            this.on('change:conn_attempted, change:conn_ok', function(m) {
                var rate = Math.round(m.get('conn_ok')/m.get('conn_attempted')*100);
                m.set('conn_rate', rate);
            });

            this.on('change:ping_sent, change:ping_received', function(m) {
                var rate = Math.round(m.get('ping_received')/m.get('ping_sent')*100);
                m.set('ping_rate', rate);
            });
        }
    });
});<commit_msg>Backbone on is space delimited.<commit_after>define([
    "_"
    , "backbone"
], function(
    _
    , Backbone
) {
    return Backbone.Model.extend({
        defaults: {
            // current connections
            conn_current: 0

            // Connection Stats
            , conn_attempted : 0
            , conn_ok        : 0
            , conn_fail      : 0
            , conn_rate      : 100

            // lifetime measurements
            , conn_lt_5s: 0
            , conn_lt_15s: 0
            , conn_lt_30s: 0
            , conn_lt_60s: 0
            , conn_lt_120s: 0
            , conn_lt_max: 0

            // Ping Stats
            , ping_sent     : 0
            , ping_received : 0
            , ping_timeout  : 0
            , ping_rate     : 12
            , ping_avg      : 0
            , ping_median   : 0
        }

        , initialize: function(options) {

            this.on('change:conn_attempted change:conn_ok', function(m) {
                var rate = Math.round(m.get('conn_ok')/m.get('conn_attempted')*100);
                m.set('conn_rate', rate);
            });

            this.on('change:ping_sent change:ping_received', function(m) {
                var rate = Math.round(m.get('ping_received')/m.get('ping_sent')*100);
                m.set('ping_rate', rate);
            });
        }
    });
});
{'fraction_non_alphanumeric': 0.1132286995515695, 'fraction_numerical': 0.026905829596412557, 'mean_word_length': 1.2308333333333332, 'pattern_counts': {'":': 0, '<': 3, '<?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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5307208', 'n_tokens_mistral': 894, 'n_tokens_neox': 784, 'n_words': 138}