summaryrefslogtreecommitdiff
path: root/shell/mr.js
diff options
context:
space:
mode:
authorEliot Horowitz <eliot@10gen.com>2009-10-15 11:26:51 -0400
committerEliot Horowitz <eliot@10gen.com>2009-10-15 11:26:51 -0400
commitadfc0973c0e0a2f07e71c33b4cf7ccc3d1efc596 (patch)
tree362b96fa700214ea7c7daa4e597f86952c6b971b /shell/mr.js
parent415f55421992c2eb2b992974d9633eb50d74ab7f (diff)
downloadmongo-adfc0973c0e0a2f07e71c33b4cf7ccc3d1efc596.tar.gz
map/reduce cleaning
Diffstat (limited to 'shell/mr.js')
-rw-r--r--shell/mr.js5
1 files changed, 5 insertions, 0 deletions
diff --git a/shell/mr.js b/shell/mr.js
index 7e66fd14b6d..6f7ebd3fc68 100644
--- a/shell/mr.js
+++ b/shell/mr.js
@@ -7,6 +7,8 @@ MR.init = function(){
$arr = [];
emit = MR.emit;
$numEmits = 0;
+ $numReduces = 0;
+ $numReducesToDB = 0;
gc(); // this is just so that keep memory size sane
}
@@ -28,6 +30,9 @@ MR.emit = function(k,v){
}
MR.doReduce = function( useDB ){
+ $numReduces++;
+ if ( useDB )
+ $numReducesToDB++;
$max = 0;
for ( var i=0; i<$arr.length; i++){
var data = $arr[i];