Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

sb

Package Overview
Dependencies
Maintainers
1
Versions
1492
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sb - npm Package Compare versions

Comparing version 0.1.3 to 0.2.0

14

lib/execute.js
var async = require('async');
module.exports = function (pool, query, count, concurrency, callback) {
module.exports = function (pool, config, query, callback) {
var tasks = [];
// Push X queries onto the async queue where X is the level of concurrency
for (var i = 0; i < concurrency; i++) {
for (var i = 0; i < config.concurrency; i++) {
tasks.push(function(task_callback) {
// Get a Sphinx connection from the pool
pool.getConnection(function(pool_error, connection) {
if (pool_error) {
task_callback(pool_error);
return task_callback(pool_error);
}

@@ -18,3 +17,3 @@

if (query_error) {
task_callback(query_error);
return task_callback(query_error);
}

@@ -31,2 +30,3 @@

// Execute all the tasks (queries) in parallel
async.parallel(tasks, function(error, results) {

@@ -37,6 +37,4 @@ if (error != null) {

count += results.length;
callback(count);
callback(results.length);
});
};

@@ -1,2 +0,2 @@

module.exports = function (start, count, cli) {
module.exports = function (start, count, config) {
var end = +new Date();

@@ -11,6 +11,7 @@ var time_taken = (end - start) / 1000;

console.log('-------------------------');
console.log(' Host: ' + cli.host);
console.log(' Port: ' + cli.port);
console.log(' Connections: ' + cli.connections);
console.log(' Concurrency: ' + cli.concurrency);
console.log(' Host: ' + config.host);
console.log(' Port: ' + config.port);
console.log(' Workers: ' + config.cpus);
console.log(' Connections: ' + config.connections);
console.log(' Concurrency: ' + config.concurrency);
console.log('');

@@ -17,0 +18,0 @@

{
"name": "sb",
"version": "0.1.3",
"version": "0.2.0",
"description": "A simple tool to benchmark a Sphinx search server.",

@@ -5,0 +5,0 @@ "dependencies": {

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc