Created
August 28, 2015 22:28
-
-
Save rdegges/d104e82ce1518e90ffaa to your computer and use it in GitHub Desktop.
Load test.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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