403Webshell
Server IP : 185.208.173.17  /  Your IP : 87.236.161.98
Web Server : Microsoft-IIS/10.0
System : Windows NT SRV8576125506 10.0 build 26100 (Windows Server 2016) AMD64
User : IUSR ( 0)
PHP Version : 7.4.13
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  C:/inetpub/wwwroot/parsmega.nuxt/node_modules/hashring/benchmarks/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : C:/inetpub/wwwroot/parsmega.nuxt/node_modules/hashring/benchmarks/methods.js
/**
 * Benchmark dependencies
 */
var Benchmark = require('benchmark');

/**
 * Different hashring drivers
 */
var hashring = require('hashring')
  , nodes = {'192.168.0.102:11212': 1, '192.168.0.103:11212': 1, '192.168.0.104:11212': 1};

/**
 * prebuild hashrings
 */
var ring = new hashring(nodes)
  , md5 = new hashring(nodes, 'md5')
  , crc32 = new hashring(nodes, 'crc32');
/**
 * Benchmark the constructing and generating of a hashring
 */
var constructing = new Benchmark.Suite;
constructing
  .add('constructing', function(){
    var r = new hashring(nodes);
  })
  .on('cycle', function(bench){
    console.log('Executing benchmark: ' + bench + '\n');
  })
  .on('complete', function(){
    // run the next benchmark if it exists
    var next = benchmarks.shift();
    if (next && next.run) next.run();
  });

var random = new Benchmark.Suite;
random
  .add('random key', function(){
    ring.getNode('key' + Math.random())
  })
  .on('cycle', function(bench){
    console.log('Executing benchmark: ' + bench + '\n');
  })
  .on('complete', function(){
    // run the next benchmark if it exists
    var next = benchmarks.shift();
    if (next && next.run) next.run();
  });

var same = new Benchmark.Suite;
same
  .add('same key', function(){
    ring.getNode('key')
  })
  .on('cycle', function(bench){
    console.log('Executing benchmark: ' + bench + '\n');
  })
  .on('complete', function(){
    // run the next benchmark if it exists
    var next = benchmarks.shift();
    if (next && next.run) next.run();
  });

var regenerating = new Benchmark.Suite;
regenerating
  .add('generate ring', function(){
    ring.generateRing()
  })
  .on('cycle', function(bench){
    console.log('Executing benchmark: ' + bench + '\n');
  })
  .on('complete', function(){
    // run the next benchmark if it exists
    var next = benchmarks.shift();
    if (next && next.run) next.run();
  });

var algorithmMD5 = new Benchmark.Suite;
algorithmMD5
  .add('md5 hashing', function(){
    md5.generateKey('key')
  })
  .on('cycle', function(bench){
    console.log('Executing benchmark: ' + bench + '\n');
  })
  .on('complete', function(){
    // run the next benchmark if it exists
    var next = benchmarks.shift();
    if (next && next.run) next.run();
  });

var algorithmCRC32 = new Benchmark.Suite;
algorithmCRC32
  .add('crc32 hashing', function(){
    crc32.generateKey('key')
  })
  .on('cycle', function(bench){
    console.log('Executing benchmark: ' + bench + '\n');
  })
  .on('complete', function(){
    // run the next benchmark if it exists
    var next = benchmarks.shift();
    if (next && next.run) next.run();
  });

var range = new Benchmark.Suite;
range
  .add('range', function(){
    ring.createRange('key', 2, true);
  })
  .on('cycle', function(bench){
    console.log('Executing benchmark: ' + bench + '\n');
  })
  .on('complete', function(){
    // run the next benchmark if it exists
    var next = benchmarks.shift();
    if (next && next.run) next.run();
  });


/**
 * Add all benchmarks that that need to be run.
 */
var benchmarks = [constructing, random, same, regenerating, algorithmMD5, algorithmCRC32, range];

// run benchmarks
if (benchmarks.length) benchmarks.shift().run();

Youez - 2016 - github.com/yon3zu
LinuXploit