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

wrk

Package Overview
Dependencies
Maintainers
2
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

wrk - npm Package Compare versions

Comparing version 1.0.0 to 1.1.0

14

index.js
var exec = require('child_process').exec;
var parseWrk = require('./lib/parseWrk')
var parseWrk = require('./lib/parseWrk');
var util = require("util");
function wrk(opts, callback) {
var cmd = opts.path || 'wrk';

@@ -18,4 +18,12 @@

cmd += ' --timeout ' + opts.timeout;
if (opts.rate)
cmd += ' -R' + opts.rate;
if (opts.printLatency)
cmd += ' --latency ';
if (opts.headers) {
Object.keys(opts.headers).forEach(function(key) {
cmd += util.format(' -H \'%s: %s\'', key, opts.headers[key]);
})
}
cmd += ' ' + opts.url;

@@ -51,2 +59,2 @@

}
}
};

@@ -39,2 +39,21 @@ module.exports = parseWrk

var histogram = [];
for (var i=0; i < lines.length; ++i) {
if (lines[i].match(/Detailed Percentile spectrum:/) && i < lines.length - 3) {
for (var l=i+4; lines[l] != ''; ++l) {
var nums = lines[l].trim().split(/[ \t]+/);
if (nums.length != 4) break;
console.log('Histo: ', nums);
histogram.push({
latency: Number(nums[0]),
percentile: Number(nums[1]),
total: Number(nums[2])
});
}
break;
}
}
if (histogram.length) {
result.histogram = histogram;
}
return result;

@@ -41,0 +60,0 @@ }

{
"name": "wrk",
"version": "1.0.0",
"version": "1.1.0",
"description": "wrk load test tool wrapper and output parser",

@@ -5,0 +5,0 @@ "main": "index.js",

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