]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osdmap: 4 decimal places for osd tree
authorSage Weil <sage@inktank.com>
Mon, 10 Sep 2012 20:01:52 +0000 (13:01 -0700)
committerSage Weil <sage@inktank.com>
Tue, 11 Sep 2012 17:48:01 +0000 (10:48 -0700)
This makes it print out more nicely for reasonable weights.

Signed-off-by: Sage Weil <sage@inktank.com>
src/osd/OSDMap.cc

index c8a46f6b46f61d7225ba96d1f82851173f1f836a..4e8502d1e8ecbc868ff43c3118e4e6e368cac8d1 100644 (file)
@@ -1358,7 +1358,7 @@ void OSDMap::print_osd_line(int cur, ostream& out) const
       out << "up\t";
     else
       out << "down\t";
-    out << (exists(cur) ? get_weightf(cur):0) << "\t";
+    out << std::setprecision(4) << (exists(cur) ? get_weightf(cur) : 0) << "\t";
   }
 }
 
@@ -1377,7 +1377,7 @@ void OSDMap::print_tree(ostream& out) const
       float weight = q.front().weight;
       q.pop_front();
 
-      out << cur << "\t" << weight << "\t";
+      out << cur << "\t" << std::setprecision(4) << weight << "\t";
       for (int k=0; k<depth; k++)
        out << "\t";