Skip to content

Instantly share code, notes, and snippets.

@rdegges
Created August 28, 2015 22:28
Show Gist options
  • Save rdegges/d104e82ce1518e90ffaa to your computer and use it in GitHub Desktop.
Save rdegges/d104e82ce1518e90ffaa to your computer and use it in GitHub Desktop.
Load test.
var async = require('async');
var stormpath = require('stormpath');
var uuid = require('uuid');
// Modify these values for testing.
var TOTAL_USERS = 10000;
var CONCURRENT_REQUESTS = 10;
var client = new stormpath.Client({
apiKey: {
id: 'xxx',
secret: 'yyy'
}
});
client.createApplication({ name: uuid.v4() }, { createDirectory: true }, function(err, application) {
if (err) {
throw err;
}
console.log('Created application: ' + application.name);
async.timesLimit(TOTAL_USERS, CONCURRENT_REQUESTS, function(n, next) {
application.createAccount({
givenName: 'Randall',
surname: 'Degges',
customData: {
woot: 'hi',
your: 'momma',
what: {
is: 'up'
}
},
email: uuid.v4() + '@gmail.com',
password: uuid.v4() + uuid.v4().toUpperCase() + '!'
}, function(err, account) {
if (err) {
throw err;
}
console.log('Created account: ' + account.email);
next();
});
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment