Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- async = require("async")
- Project = require('./app/js/models/Project').Project
- _ = require("lodash")
- warmup = "55928319efc30e705817817e"
- smallproject = "561e86173cfc7400525834a6"
- twokproject = "5637a97beafc8c7b5bfc487a"
- fourkproject = "55ef4b39f5e895afbaf2085d"
- realmassive = "57b1ea8674e706f567b5afe8"
- tenRuns = (key, callback)->
- findAndTime = (i, cb)->
- t = new Date()
- Project.findById key, (err, project)->
- total = new Date()-t
- cb(null, total)
- a = [0..10]
- async.mapSeries a, findAndTime, (err, times)->
- result =
- average: _.sum(times) / a.length
- times : times
- callback(null, result)
- jobs =
- warmup: (cb)->
- tenRuns warmup, cb
- smallproject: (cb)->
- tenRuns smallproject, cb
- twokproject: (cb)->
- tenRuns twokproject, cb
- fourkproject: (cb)->
- tenRuns fourkproject, cb
- realmassive: (cb)->
- tenRuns realmassive, cb
- async.series jobs, (err, results)->
- console.log results
- process.exit()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement