ns

node-stress

Node.js light weight module to apply specific load to a REST API and obtain the statitics

Showing:

Popularity

Downloads/wk

1

GitHub Stars

1

Maintenance

Last Commit

8yrs ago

Contributors

1

Package

Dependencies

0

Size (min+gzip)

0.6KB

License

MIT

Type Definitions

Tree-Shakeable

No?

Categories

Readme

node-stress

Light weight Node.js module to apply specified load on a REST API and retrieve the response statistics. I gives the counts of good,bad and errored responses along with the time taken to process them all.

Installation

npm install node-stress

Usage

var stress = require("./node-stress");

stress({
            
        host: 'rest.api.url',
        port: 80,
        path: '/getData.php?command=1'
        
        
    },RequestCount,function(data){
        
        console.log("Requests Sent : "+data.ReqStarted);
        
        if(data.response.GoodResponse)
            console.log("Good Response (200 OK) : ", data.response.GoodResponse);
            
        if(data.response.BadResponse)
            console.log("Bad Response : ", data.response.BadResponse);
            
        if(data.response.ErrorResponse) {
            console.log("Error Response : ", data.response.ErrorResponse);
            console.log(JSON.stringify(data.response.ErrorList,undefined,4));
        }
        console.log("Test Stats : "+data.fact);

});

Parameters

host - the url of the REST API after stripping down the starting http://. For more info check the input parameter for the node sample http request. port - port at which the REST API runs path - path to the page we are sending request

RequestCount - the load to be applied in number (eg:1000)

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100