From b4f5ffa3a4ef36ef1cfdf06ef46ebe02c9233efd Mon Sep 17 00:00:00 2001 From: Eliot Horowitz Date: Tue, 9 Nov 2010 11:50:01 -0500 Subject: [PATCH] better mongostat output for dbs > 1tb --- tools/stat.cpp | 7 +++++++ 1 file changed, 7 insertions(+) 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() );