Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/flesler/stress-node

Stress test library for Node JS
https://github.com/flesler/stress-node

Last synced: 23 days ago
JSON representation

Stress test library for Node JS

Awesome Lists containing this project

README

        

stress-node
===========

## Description

Stress test library for Node JS

## Installation

Using npm:

$ npm install stress-node

## Usage example

```js
var stress = require('stress-node');
stress({
url: 'http://google.com',
method: 'GET',
amount: 1000,
concurrent: 5,
data: null,
progress: function(report) {
}
}, function(report) {
});
```

## The report object

Both functions will receive a report object that looks like this:

```js
{
url: 'http://google.com',
ok: 990,
fail: 5,
completed: 995,
ongoing: 4,
pending: 1,
total: 1000,
start: [object Date],
end: [object Date],
responses: [
{ status:200, amount: 990 }
],
errors: [
{ code: 'ECONNREFUSED', amount: 4 },
{ code: 404, amount: 1 }
]
}
```

# Stress server

I also made a CLI server that runs a stress test using this library.

Go check it out at https://github.com/flesler/stress-node-server.

# TODOs

- `timeout` setting doesn't seem to be working correctly