Problem Description
I was testing out my .mongorc.js for the first time in the 0.12.0 version and I noticed we don’t support Date.timeFunc() yet. Is that something we might consider?
See: https://github.com/mongodb/mongo/blob/master/src/mongo/shell/types.js#L28
I use it to do very quick perf testing in the shell, e.g.,
function avgTime(func, runs) { a = []; runs = runs || 10; for (var i=0; i<runs; i++) { a.push(Date.timeFunc(func)) } out = { avg: Array.avg(a), stdDev: Array.stdDev(a) }; out.sampStdDev = Math.sqrt((1/(runs-1)) * (out.stdDev*out.stdDev)); return out; } avgTime(function() {db.zips.aggregate({$group:{_id: '$state', count: $sum:'$pop'}}})}, 30)
Steps to Reproduce
Expected Results
Actual Results
Additional Notes
- depends on
-
MONGOSH-701 Add snippet package manager
- Closed
- related to
-
MONGOSH-620 Missing methods on JS builtins from the old shell: what should we support?
- Closed