<commit_before>var express = require('express');
var morgan = require('morgan');
var os=require('os');
var sys = require('sys');
var exec = require('child_process').exec;


var app = express();
app.use(morgan('dev'));

var interfaces = os.networkInterfaces();
var addresses = [];
for (k in interfaces) {
    for (k2 in interfaces[k]) {
        var address = interfaces[k][k2];
        if (address.family == 'IPv4' && !address.internal) {
            addresses.push(address.address)
        }
    }
}

app.get('/', function(req, res){
        var date = new Date();
        res.json(200, { "time": date, "serverInternalIp": addresses[0], "msg":"Hello World"});
});

app.get('/generateLoad/:seconds', function(req, res){
        console.log(req.params.seconds);
        if (req.params.seconds % 1 === 0){
                var date = new Date();
                function puts(error, stdout, stderr) {
                        res.send(date + ' ' + addresses[0] + ' ' + stdout);
                }
                exec("stress --cpu 1 --timeout " + req.params.seconds + "s", puts);
        }else{
                res.send(400, "ERROR: enter an integer for seconds");
        }
});

app.listen(process.env.PORT || 3000);
console.log('Local address: '+addresses[0]);
console.log('Server listening on port: ' + (process.env.PORT || 3000));<commit_msg>update server message<commit_after>var express = require('express');
var morgan = require('morgan');
var os=require('os');
var sys = require('sys');
var exec = require('child_process').exec;


var app = express();
app.use(morgan('dev'));

var interfaces = os.networkInterfaces();
var addresses = [];
for (k in interfaces) {
    for (k2 in interfaces[k]) {
        var address = interfaces[k][k2];
        if (address.family == 'IPv4' && !address.internal) {
            addresses.push(address.address)
        }
    }
}

app.get('/', function(req, res){
        var date = new Date();
        res.json(200, { "time": date, "serverInternalIp": addresses[0], "msg":"Hello Drone!"});
});

app.get('/generateLoad/:seconds', function(req, res){
        console.log(req.params.seconds);
        if (req.params.seconds % 1 === 0){
                var date = new Date();
                function puts(error, stdout, stderr) {
                        res.send(date + ' ' + addresses[0] + ' ' + stdout);
                }
                exec("stress --cpu 1 --timeout " + req.params.seconds + "s", puts);
        }else{
                res.send(400, "ERROR: enter an integer for seconds");
        }
});

app.listen(process.env.PORT || 3000);
console.log('Local address: '+addresses[0]);
console.log('Server listening on port: ' + (process.env.PORT || 3000));
{'fraction_non_alphanumeric': 0.178743961352657, 'fraction_numerical': 0.017094017094017096, 'mean_word_length': 2.5845539280958723, 'pattern_counts': {'":': 6, '<': 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': '5942499', 'n_tokens_mistral': 856, 'n_tokens_neox': 802, 'n_words': 197}