mirror of
https://github.com/ceph/ceph
synced 2025-01-02 00:52:22 +00:00
Merge pull request #2338 from ceph/wip-reweight
mon/OSDMonitor: make reweight_by_* output less misleading
This commit is contained in:
commit
b97f807a89
@ -525,11 +525,11 @@ int OSDMonitor::reweight_by_utilization(int oload, std::string& out_str,
|
||||
|
||||
ostringstream oss;
|
||||
char buf[128];
|
||||
snprintf(buf, sizeof(buf), "average_util: %04f, overload_util: %04f. ",
|
||||
snprintf(buf, sizeof(buf), "average %04f, overload %04f. ",
|
||||
average_util, overload_util);
|
||||
oss << buf;
|
||||
std::string sep;
|
||||
oss << "overloaded osds: ";
|
||||
oss << "reweighted: ";
|
||||
bool changed = false;
|
||||
for (ceph::unordered_map<int,osd_stat_t>::const_iterator p =
|
||||
pgm.osd_stat.begin();
|
||||
@ -550,7 +550,7 @@ int OSDMonitor::reweight_by_utilization(int oload, std::string& out_str,
|
||||
unsigned new_weight = (unsigned)((average_util / util) * (float)weight);
|
||||
pending_inc.new_weight[p->first] = new_weight;
|
||||
char buf[128];
|
||||
snprintf(buf, sizeof(buf), "%d [%04f -> %04f]", p->first,
|
||||
snprintf(buf, sizeof(buf), "osd.%d [%04f -> %04f]", p->first,
|
||||
(float)weight / (float)0x10000,
|
||||
(float)new_weight / (float)0x10000);
|
||||
oss << buf << sep;
|
||||
@ -566,7 +566,7 @@ int OSDMonitor::reweight_by_utilization(int oload, std::string& out_str,
|
||||
sep = ", ";
|
||||
pending_inc.new_weight[p->first] = new_weight;
|
||||
char buf[128];
|
||||
snprintf(buf, sizeof(buf), "%d [%04f -> %04f]", p->first,
|
||||
snprintf(buf, sizeof(buf), "osd.%d [%04f -> %04f]", p->first,
|
||||
(float)weight / (float)0x10000,
|
||||
(float)new_weight / (float)0x10000);
|
||||
oss << buf << sep;
|
||||
|
Loading…
Reference in New Issue
Block a user