summaryrefslogtreecommitdiff
path: root/tools/stat.cpp
diff options
context:
space:
mode:
authorEliot Horowitz <eliot@10gen.com>2010-02-28 12:35:18 -0500
committerEliot Horowitz <eliot@10gen.com>2010-02-28 12:35:18 -0500
commitb2705cfd32d531c8efad692963ed7fc75990630a (patch)
tree2d4ddd3f2e55b1b184669124116046aa5234be68 /tools/stat.cpp
parent30dcf4bf83f0da5f4e2d3b63d9f0ab537ec38ee7 (diff)
downloadmongo-b2705cfd32d531c8efad692963ed7fc75990630a.tar.gz
configurable sleep
Diffstat (limited to 'tools/stat.cpp')
-rw-r--r--tools/stat.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/tools/stat.cpp b/tools/stat.cpp
index f568d66e785..be7b09620cd 100644
--- a/tools/stat.cpp
+++ b/tools/stat.cpp
@@ -37,6 +37,12 @@ namespace mongo {
Stat() : Tool( "stat" , false , "admin" ){
_sleep = 1;
_rowNum = 0;
+
+ add_hidden_options()
+ ( "sleep" , po::value<int>() , "time to sleep between calls" )
+ ;
+
+ addPositionArg( "sleep" , 1 );
}
BSONObj stats(){
@@ -113,10 +119,11 @@ namespace mongo {
}
int run(){
+ _sleep = getParam( "sleep" , _sleep );
BSONObj prev = stats();
if ( prev.isEmpty() )
return -1;
-
+
while ( 1 ){
sleepsecs(_sleep);
BSONObj now = stats();