Signed-off-by: Sage Weil <sage@redhat.com>
protected:
virtual void dump_item(const CrushTreeDumper::Item &qi, ostream *out) {
- std::streamsize p = out->precision();
-
*out << qi.id << "\t"
- << std::setprecision(4) << qi.weight << "\t";
+ << weightf_t(qi.weight) << "\t";
for (int k=0; k < qi.depth; k++)
*out << "\t";
{
assert(qi.id >= 0 && (size_t)qi.id < weights.size());
*out << "osd." << qi.id << "\t"
- << (double)weights[qi.id] / (double)0x10000 << "\t";
+ << weightf_t((double)weights[qi.id] / (double)0x10000) << "\t";
}
- *out << std::setprecision(p) << "\n";
+ *out << "\n";
}
private:
virtual void dump_item(const CrushTreeDumper::Item &qi, TextTable *tbl) {
*tbl << qi.id
- << stringify(weightf_t(qi.weight));
+ << weightf_t(qi.weight);
ostringstream name;
for (int k = 0; k < qi.depth; k++)
<< 0;
} else {
*tbl << (osdmap->is_up(qi.id) ? "up" : "down")
- << stringify(weightf_t(osdmap->get_weightf(qi.id)))
- << osdmap->get_primary_affinityf(qi.id);
+ << weightf_t(osdmap->get_weightf(qi.id))
+ << weightf_t(osdmap->get_primary_affinityf(qi.id));
}
}
*tbl << TextTable::endrow;