diff options
author | Eliot Horowitz <eliot@10gen.com> | 2010-02-28 12:35:18 -0500 |
---|---|---|
committer | Eliot Horowitz <eliot@10gen.com> | 2010-02-28 12:35:18 -0500 |
commit | b2705cfd32d531c8efad692963ed7fc75990630a (patch) | |
tree | 2d4ddd3f2e55b1b184669124116046aa5234be68 /tools/stat.cpp | |
parent | 30dcf4bf83f0da5f4e2d3b63d9f0ab537ec38ee7 (diff) | |
download | mongo-b2705cfd32d531c8efad692963ed7fc75990630a.tar.gz |
configurable sleep
Diffstat (limited to 'tools/stat.cpp')
-rw-r--r-- | tools/stat.cpp | 9 |
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(); |