<commit_before>
var util = require('util');
var debug = require('debug')('qufox');
var cluster = require('cluster');
var QufoxServer = require('../qufox-server');
var QufoxClient = require('../client/qufox-client');

debug('Start Test.');


if (cluster.isMaster) {
  for (var i = 0; i < 1; i++) {
    cluster.fork();
  }

  cluster.on('online', function (worker){
    debug('worker ' + worker.id + ' online  [pid:'+worker.process.pid+']');
  });

  cluster.on('listening', function (worker, address){
    debug('worker ' + worker.id + ' listening '+address.address+':'+address.port+' [pid:'+worker.process.pid+']');
  });
}
else {
  var server = new QufoxServer({
    listenTarget: 14000,
    redisUrl: 'redis://localhost',
    // redisSentinel: config.redisSentinel,
    instanceName: 'test',
  });
}

debug(new QufoxClient());
//
// for (var index = 0; index < 1000; ++index){
//
// // console.log(util.inspect(server.io._adapter, { depth: 1 }));
//   // debug(util.inspect);
// }
<commit_msg>Update test code.<commit_after>
var util = require('util');
var debug = require('debug')('qufox');
var cluster = require('cluster');
var QufoxServer = require('../qufox-server');

debug('Start Test.');


if (cluster.isMaster) {
  for (var i = 0; i < 1; i++) {
    cluster.fork();
  }

  cluster.on('online', function (worker){
    debug('worker ' + worker.id + ' online  [pid:'+worker.process.pid+']');
  });

  cluster.on('listening', function (worker, address){
    debug('worker ' + worker.id + ' listening '+address.address+':'+address.port+' [pid:'+worker.process.pid+']');

    var client1 = require('qufox-client')('http://localhost:' + address.port);

    client1.join('testSession',
    function (packet){
      debug(packet);
    }, function (){
      debug('join complete');
      client1.send('testSession', 'echo complete', true);
      //
      // var client2 = require('../index')(serverUrl, options);
      // setStatusChangedLog(client2, 'client2');
      // client2.send('testSession', 'send complete');
    });
  });
}
else {
  var server = new QufoxServer({
    listenTarget: 14000,
    redisUrl: 'redis://localhost',
    // redisSentinel: config.redisSentinel,
    instanceName: 'test',
  });
}

//
// for (var index = 0; index < 1000; ++index){
//
// // console.log(util.inspect(server.io._adapter, { depth: 1 }));
//   // debug(util.inspect);
// }

{'fraction_non_alphanumeric': 0.21344040574809806, 'fraction_numerical': 0.013947590870667794, 'mean_word_length': 3.4744801512287333, 'pattern_counts': {'":': 0, '<': 7, '<?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': '4757288', 'n_tokens_mistral': 813, 'n_tokens_neox': 784, 'n_words': 161}