summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorEliot Horowitz <eliot@10gen.com>2010-11-09 11:50:01 -0500
committerEliot Horowitz <eliot@10gen.com>2010-11-09 11:50:01 -0500
commitb4f5ffa3a4ef36ef1cfdf06ef46ebe02c9233efd (patch)
treedd6172fc0d0286eae8b1ff7d53764b642605a7b8 /tools
parentc5f3d8fb82101f8d38cedaf7448c77a44dc80bf0 (diff)
downloadmongo-b4f5ffa3a4ef36ef1cfdf06ef46ebe02c9233efd.tar.gz
better mongostat output for dbs > 1tb
Diffstat (limited to 'tools')
-rw-r--r--tools/stat.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/tools/stat.cpp b/tools/stat.cpp
index 460bca0e65a..5c0835167b9 100644
--- a/tools/stat.cpp
+++ b/tools/stat.cpp
@@ -153,6 +153,13 @@ namespace mongo {
unit = "g";
sz /= 1024;
}
+
+ if ( sz > 1024 ){
+ string s = str::stream() << (int)sz << unit;
+ _append( result , name , width , s );
+ return;
+ }
+
stringstream ss;
ss << setprecision(3) << sz << unit;
_append( result , name , width , ss.str() );