From edaa0577b56906c6732dcbff3db41ca0056089c5 Mon Sep 17 00:00:00 2001 From: "U-tellus\\cwestin" Date: Mon, 13 Jun 2011 12:04:13 -0700 Subject: simple aggregation benchmark --- jstests/aggregation/mrabench.js | 61 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100755 jstests/aggregation/mrabench.js (limited to 'jstests/aggregation') diff --git a/jstests/aggregation/mrabench.js b/jstests/aggregation/mrabench.js new file mode 100755 index 00000000000..915076435c7 --- /dev/null +++ b/jstests/aggregation/mrabench.js @@ -0,0 +1,61 @@ +/* + In order to run this, you need to have a local copy of the usage data. + + One way to do this is to dump and restore it using mongodump and mongorestore + */ + +db = db.getSisterDB( "mongousage" ) + +function rollupMap() { + emit( this._id.t , { total : this.value , unique : 1 } ) +} + +function rollupReduce(key, values) { + var res = { total : 0 , unique : 0 }; + for ( var i=0; i