Load or Stress Testing in nodejs

Hitu Bansal

I am using nodejs with express.

I have created a signup form with some fields. I want to check when 1000 user signups on same time. What will happen? Is there is any module available or any simple example. How to enter fake data.

How can i write a test case for that. I googled it, but didn't get result.

Thanks

Daniel

Use faker to generate the fake data and request to send the data to the server. You can use async.each to asynchronously do 1000 signups at the same time.

var faker = require('faker');
var async = require('async');

var number_of_signups = 1000;
var identities = [];

for (var i=0; i < number_of_signups; i++) {
  identities.push({
    name: faker.name.findName(),
    email: faker.internet.email(),
    password: faker.internet.password()
  });
}

function submit(identity, callback) {
  var opts = {
    url: 'http://youdomain.com/signup-endpoint',
    method: 'POST',
    json: identity
  };
  request(opts, function(err, connection, body) {
    if(err) return callback(err);
    callback();
  });
}

async.each(identities, submit, function(err) {
  if(err) throw err;
  console.log('done...');
  process.exit();
});

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Load or Stress Testing in nodejs

From Dev

Stress testing in NodeJS/Socket.io for 1000 users?

From Dev

Preventing abusing of load and stress testing software like JMeter

From Dev

Preventing abusing of load and stress testing software like JMeter

From Dev

Stress Testing with git

From Dev

Stress testing WebSockets in Jmeter

From Dev

Parse.com stress testing iOS application

From Dev

Overclock monitoring and stress testing tools in Ubuntu

From Dev

Overclock monitoring and stress testing tools in Ubuntu

From Dev

Stress testing SD cards using linux

From Dev

stress testing new ram appears to fail

From Dev

Parse.com stress testing iOS application

From Dev

PHP & stress tests - load large file into memory

From Dev

Stress testing software (but I need run it step by step) with locust

From Dev

Setting/getting session variable in Load Impact (stress test tool) to perform stress test

From Dev

Nodejs - testing AWS with Mocha

From Dev

Ajax testing with Mocha - Nodejs

From Dev

Testing promises in NodeJS

From Dev

NodeJs and Mocha testing the response

From Dev

Testing request with Mocha in NodeJs

From Dev

Load Testing CassandraDB with JMeter

From Dev

Spring load testing

From Dev

Load testing a notification hub

From Dev

Load dynamic html with nodejs

From Dev

Cannot load bootstrap to nodejs

From Dev

Testing with gulp + babel + jasmine on nodejs

From Dev

Testing NodeJS with Mocha - "Require is not defined"

From Dev

NodeJS supertest - testing routes with certificates

From Dev

Testing nodejs harmony generator method