summaryrefslogtreecommitdiff
path: root/shell/db.js
diff options
context:
space:
mode:
authorEliot Horowitz <eliot@10gen.com>2009-09-15 21:09:56 -0400
committerEliot Horowitz <eliot@10gen.com>2009-09-15 21:09:56 -0400
commit4d63454bc6e4cadd27ecebcb642ef8b0c292596f (patch)
tree2f645e1aab68132e000cdd9da600102c50350dec /shell/db.js
parent668d26b514126e2cdaf5b1c8b258c845b293feab (diff)
downloadmongo-4d63454bc6e4cadd27ecebcb642ef8b0c292596f.tar.gz
printCollectionStats
Diffstat (limited to 'shell/db.js')
-rw-r--r--shell/db.js11
1 files changed, 11 insertions, 0 deletions
diff --git a/shell/db.js b/shell/db.js
index 9530447cec8..fa533deb537 100644
--- a/shell/db.js
+++ b/shell/db.js
@@ -263,9 +263,20 @@ DB.prototype.help = function() {
print("\tdb.getCollectionNames()");
print("\tdb.currentOp() displays the current operation in the db" );
print("\tdb.killOp() kills the current operation in the db" );
+ print("\tdb.printCollectionStats()" );
print("\tdb.version() current version of the server" );
}
+DB.prototype.printCollectionStats = function(){
+ this.getCollectionNames().forEach(
+ function(z){
+ print( z );
+ printjson( db[z].stats() );
+ print( "---" );
+ }
+ );
+}
+
/**
* <p> Set profiling level for your db. Profiling gathers stats on query performance. </p>
*