<commit_before>var HttpClient = require('request');

var nginx = (function () {/*
  server 172.16.31.10:9000 weight=8; # salim2
  server 192.168.3.11:9000 weight=12; # hexal
  # server 192.168.127.12:9009 weight=4; # matthews (openings)
  # server 192.168.127.12:9009 weight=8; # nafis (expired)
  server 172.16.58.3:9009 weight=2; # paul
  # server 172.16.31.10:9009 weight=8; # drazak (expired)
  server jaldus.ddns.net:9009 weight=8; # jaldus
  server 192.168.127.12:9009 weight=4; # neary (ks3)
  server yubaba.mindleaking.org:10080 weight=3; # sarken
  server karmeliet.darklord.fr:9452 weight=3; # pat
*/}).toString().match(/[^]*\/\*([^]*)\*\/\}$/)[1];

var servers = nginx.split(/\n/).map(function(line) {
  return line.trim();
}).filter(function(line) {
  return line.length && line[0] != '#';
}).map(function(line) {
  return line.split(' ')[1];
});

function checks() {
  servers.forEach(function(server) {
    var url = 'http://' + server + '/ai/move';
    HttpClient({
      url: url,
      timeout: 8000
    }, function (error, response, body) {
      if (error)
        console.log('[ERROR] ' + error + ' ' + server);
      else if (body.length != 4)
        console.log('[ERROR] ' + body + ' ' + server);
      else
        process.stdout.write('.');
        // console.log('[OK] ' + body + ' ' + server);
    });
  });
}

setInterval(checks, 10 * 60 * 1000);
checks();<commit_msg>tweak AI monitor<commit_after>var HttpClient = require('request');

var nginx = (function () {/*
  server 172.16.31.10:9000 weight=8; # salim2
  server 192.168.3.11:9000 weight=12; # hexal
  server 192.168.127.12:9009 weight=4;
  # server 192.168.127.12:9009 weight=8; # nafis (expired)
  server 172.16.58.3:9009 weight=2; # paul
  # server 172.16.31.10:9009 weight=8; # drazak (expired)
  server jaldus.ddns.net:9009 weight=8; # jaldus
  server 192.168.127.12:9009 weight=4; # neary (ks3)
  server yubaba.mindleaking.org:10080 weight=3; # sarken
  server karmeliet.darklord.fr:9452 weight=3; # pat
*/}).toString().match(/[^]*\/\*([^]*)\*\/\}$/)[1];

var servers = nginx.split(/\n/).map(function(line) {
  return line.trim();
}).filter(function(line) {
  return line.length && line[0] != '#';
}).map(function(line) {
  return line.split(' ')[1];
});

function checks() {
  servers.forEach(function(server) {
    var url = 'http://' + server + '/ai/move';
    HttpClient({
      url: url,
      timeout: 8000
    }, function (error, response, body) {
      if (error)
        console.log('[ERROR] ' + error + ' ' + server);
      else if (body.length != 4)
        console.log('[ERROR] ' + body + ' ' + server);
      else
        process.stdout.write('.');
        // console.log('[OK] ' + body + ' ' + server);
    });
  });
}

setInterval(checks, 1 * 60 * 1000);
checks();
{'fraction_non_alphanumeric': 0.20577617328519857, 'fraction_numerical': 0.09927797833935018, 'mean_word_length': 3.1420029895366217, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 14, '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': '7166413', 'n_tokens_mistral': 1214, 'n_tokens_neox': 1040, 'n_words': 205}