]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/mon/PGMap.cc
update sources to 12.2.8
[ceph.git] / ceph / src / mon / PGMap.cc
index 909e3a8163085cc45ce3069c197b91ca6e570257..c5def7d1ce6b4a067ab6e319048271db313b5319 100644 (file)
@@ -171,12 +171,12 @@ void PGMapDigest::print_summary(Formatter *f, ostream *out) const
   } else {
     *out << "    pools:   " << pg_pool_sum.size() << " pools, "
          << num_pg << " pgs\n";
-    *out << "    objects: " << si_t(pg_sum.stats.sum.num_objects) << " objects, "
-         << prettybyte_t(pg_sum.stats.sum.num_bytes) << "\n";
+    *out << "    objects: " << si_u_t(pg_sum.stats.sum.num_objects) << " objects, "
+         << byte_u_t(pg_sum.stats.sum.num_bytes) << "\n";
     *out << "    usage:   "
-         << kb_t(osd_sum.kb_used) << " used, "
-         << kb_t(osd_sum.kb_avail) << " / "
-         << kb_t(osd_sum.kb) << " avail\n";
+         << byte_u_t(osd_sum.kb_used << 10) << " used, "
+         << byte_u_t(osd_sum.kb_avail << 10) << " / "
+         << byte_u_t(osd_sum.kb << 10) << " avail\n";
     *out << "    pgs:     ";
   }
 
@@ -296,10 +296,10 @@ void PGMapDigest::print_oneline_summary(Formatter *f, ostream *out) const
   if (out)
     *out << num_pg << " pgs: "
          << states << "; "
-         << prettybyte_t(pg_sum.stats.sum.num_bytes) << " data, "
-         << kb_t(osd_sum.kb_used) << " used, "
-         << kb_t(osd_sum.kb_avail) << " / "
-         << kb_t(osd_sum.kb) << " avail";
+         << byte_u_t(pg_sum.stats.sum.num_bytes) << " data, "
+         << byte_u_t(osd_sum.kb_used << 10) << " used, "
+         << byte_u_t(osd_sum.kb_avail << 10) << " / "
+         << byte_u_t(osd_sum.kb << 10) << " avail";
   if (f) {
     f->dump_unsigned("num_pgs", num_pg);
     f->dump_unsigned("num_bytes", pg_sum.stats.sum.num_bytes);
@@ -320,20 +320,20 @@ void PGMapDigest::print_oneline_summary(Formatter *f, ostream *out) const
     if (pos_delta.stats.sum.num_rd) {
       int64_t rd = (pos_delta.stats.sum.num_rd_kb << 10) / (double)stamp_delta;
       if (out)
-       *out << pretty_si_t(rd) << "B/s rd, ";
+       *out << byte_u_t(rd) << "/s rd, ";
       if (f)
        f->dump_unsigned("read_bytes_sec", rd);
     }
     if (pos_delta.stats.sum.num_wr) {
       int64_t wr = (pos_delta.stats.sum.num_wr_kb << 10) / (double)stamp_delta;
       if (out)
-       *out << pretty_si_t(wr) << "B/s wr, ";
+       *out << byte_u_t(wr) << "/s wr, ";
       if (f)
        f->dump_unsigned("write_bytes_sec", wr);
     }
     int64_t iops = (pos_delta.stats.sum.num_rd + pos_delta.stats.sum.num_wr) / (double)stamp_delta;
     if (out)
-      *out << pretty_si_t(iops) << "op/s";
+      *out << si_u_t(iops) << "op/s";
     if (f)
       f->dump_unsigned("io_sec", iops);
   }
@@ -425,10 +425,10 @@ void PGMapDigest::recovery_rate_summary(Formatter *f, ostream *out,
       f->dump_int("num_bytes_recovered", pos_delta.stats.sum.num_bytes_recovered);
       f->dump_int("num_keys_recovered", pos_delta.stats.sum.num_keys_recovered);
     } else {
-      *out << pretty_si_t(bps) << "B/s";
+      *out << byte_u_t(bps) << "/s";
       if (pos_delta.stats.sum.num_keys_recovered)
-       *out << ", " << pretty_si_t(kps) << "keys/s";
-      *out << ", " << pretty_si_t(objps) << "objects/s";
+       *out << ", " << si_u_t(kps) << "keys/s";
+      *out << ", " << si_u_t(objps) << "objects/s";
     }
   }
 }
@@ -478,7 +478,7 @@ void PGMapDigest::client_io_rate_summary(Formatter *f, ostream *out,
       if (f) {
        f->dump_int("read_bytes_sec", rd);
       } else {
-       *out << pretty_si_t(rd) << "B/s rd, ";
+       *out << byte_u_t(rd) << "/s rd, ";
       }
     }
     if (pos_delta.stats.sum.num_wr) {
@@ -486,7 +486,7 @@ void PGMapDigest::client_io_rate_summary(Formatter *f, ostream *out,
       if (f) {
        f->dump_int("write_bytes_sec", wr);
       } else {
-       *out << pretty_si_t(wr) << "B/s wr, ";
+       *out << byte_u_t(wr) << "/s wr, ";
       }
     }
     int64_t iops_rd = pos_delta.stats.sum.num_rd / (double)delta_stamp;
@@ -495,7 +495,7 @@ void PGMapDigest::client_io_rate_summary(Formatter *f, ostream *out,
       f->dump_int("read_op_per_sec", iops_rd);
       f->dump_int("write_op_per_sec", iops_wr);
     } else {
-      *out << pretty_si_t(iops_rd) << "op/s rd, " << pretty_si_t(iops_wr) << "op/s wr";
+      *out << si_u_t(iops_rd) << "op/s rd, " << si_u_t(iops_wr) << "op/s wr";
     }
   }
 }
@@ -530,7 +530,7 @@ void PGMapDigest::cache_io_rate_summary(Formatter *f, ostream *out,
     if (f) {
       f->dump_int("flush_bytes_sec", flush);
     } else {
-      *out << pretty_si_t(flush) << "B/s flush";
+      *out << byte_u_t(flush) << "/s flush";
       have_output = true;
     }
   }
@@ -541,7 +541,7 @@ void PGMapDigest::cache_io_rate_summary(Formatter *f, ostream *out,
     } else {
       if (have_output)
        *out << ", ";
-      *out << pretty_si_t(evict) << "B/s evict";
+      *out << byte_u_t(evict) << "/s evict";
       have_output = true;
     }
   }
@@ -552,7 +552,7 @@ void PGMapDigest::cache_io_rate_summary(Formatter *f, ostream *out,
     } else {
       if (have_output)
        *out << ", ";
-      *out << pretty_si_t(promote) << "op/s promote";
+      *out << si_u_t(promote) << "op/s promote";
       have_output = true;
     }
   }
@@ -562,7 +562,7 @@ void PGMapDigest::cache_io_rate_summary(Formatter *f, ostream *out,
     } else {
       if (have_output)
        *out << ", ";
-      *out << pretty_si_t(pos_delta.stats.sum.num_flush_mode_low) << "PG(s) flushing";
+      *out << si_u_t(pos_delta.stats.sum.num_flush_mode_low) << "PG(s) flushing";
       have_output = true;
     }
   }
@@ -572,7 +572,7 @@ void PGMapDigest::cache_io_rate_summary(Formatter *f, ostream *out,
     } else {
       if (have_output)
        *out << ", ";
-      *out << pretty_si_t(pos_delta.stats.sum.num_flush_mode_high) << "PG(s) flushing (high)";
+      *out << si_u_t(pos_delta.stats.sum.num_flush_mode_high) << "PG(s) flushing (high)";
       have_output = true;
     }
   }
@@ -582,7 +582,7 @@ void PGMapDigest::cache_io_rate_summary(Formatter *f, ostream *out,
     } else {
       if (have_output)
        *out << ", ";
-      *out << pretty_si_t(pos_delta.stats.sum.num_evict_mode_some) << "PG(s) evicting";
+      *out << si_u_t(pos_delta.stats.sum.num_evict_mode_some) << "PG(s) evicting";
       have_output = true;
     }
   }
@@ -592,7 +592,7 @@ void PGMapDigest::cache_io_rate_summary(Formatter *f, ostream *out,
     } else {
       if (have_output)
        *out << ", ";
-      *out << pretty_si_t(pos_delta.stats.sum.num_evict_mode_full) << "PG(s) evicting (full)";
+      *out << si_u_t(pos_delta.stats.sum.num_evict_mode_full) << "PG(s) evicting (full)";
     }
   }
 }
@@ -745,12 +745,12 @@ void PGMapDigest::dump_pool_stats_full(
         if (pool->quota_max_objects == 0)
           tbl << "N/A";
         else
-          tbl << si_t(pool->quota_max_objects);
+          tbl << si_u_t(pool->quota_max_objects);
 
         if (pool->quota_max_bytes == 0)
           tbl << "N/A";
         else
-          tbl << si_t(pool->quota_max_bytes);
+          tbl << byte_u_t(pool->quota_max_bytes);
       }
 
     }
@@ -794,16 +794,16 @@ void PGMapDigest::dump_fs_stats(stringstream *ss, Formatter *f, bool verbose) co
     if (verbose) {
       tbl.define_column("OBJECTS", TextTable::LEFT, TextTable::RIGHT);
     }
-    tbl << stringify(si_t(osd_sum.kb*1024))
-        << stringify(si_t(osd_sum.kb_avail*1024))
-        << stringify(si_t(osd_sum.kb_used*1024));
+    tbl << stringify(byte_u_t(osd_sum.kb*1024))
+        << stringify(byte_u_t(osd_sum.kb_avail*1024))
+        << stringify(byte_u_t(osd_sum.kb_used*1024));
     float used = 0.0;
     if (osd_sum.kb > 0) {
       used = ((float)osd_sum.kb_used / osd_sum.kb);
     }
     tbl << percentify(used*100);
     if (verbose) {
-      tbl << stringify(si_t(pg_sum.stats.sum.num_objects));
+      tbl << stringify(si_u_t(pg_sum.stats.sum.num_objects));
     }
     tbl << TextTable::endrow;
 
@@ -849,15 +849,15 @@ void PGMapDigest::dump_object_stat_sum(
       f->dump_int("raw_bytes_used", sum.num_bytes * raw_used_rate * curr_object_copies_rate);
     }
   } else {
-    tbl << stringify(si_t(sum.num_bytes));
+    tbl << stringify(byte_u_t(sum.num_bytes));
     tbl << percentify(used*100);
-    tbl << si_t(avail / raw_used_rate);
+    tbl << byte_u_t(avail / raw_used_rate);
     tbl << sum.num_objects;
     if (verbose) {
-      tbl << stringify(si_t(sum.num_objects_dirty))
-          << stringify(si_t(sum.num_rd))
-          << stringify(si_t(sum.num_wr))
-          << stringify(si_t(sum.num_bytes * raw_used_rate * curr_object_copies_rate));
+      tbl << stringify(si_u_t(sum.num_objects_dirty))
+          << stringify(byte_u_t(sum.num_rd))
+          << stringify(byte_u_t(sum.num_wr))
+          << stringify(byte_u_t(sum.num_bytes * raw_used_rate * curr_object_copies_rate));
     }
   }
 }
@@ -1960,9 +1960,9 @@ void PGMap::dump_osd_stats(ostream& ss) const
        p != osd_stat.end();
        ++p) {
     tab << p->first
-        << si_t(p->second.kb_used << 10)
-        << si_t(p->second.kb_avail << 10)
-        << si_t(p->second.kb << 10)
+        << byte_u_t(p->second.kb_used << 10)
+        << byte_u_t(p->second.kb_avail << 10)
+        << byte_u_t(p->second.kb << 10)
         << p->second.hb_peers
         << get_num_pg_by_osd(p->first)
         << get_num_primary_pg_by_osd(p->first)
@@ -1970,9 +1970,9 @@ void PGMap::dump_osd_stats(ostream& ss) const
   }
 
   tab << "sum"
-      << si_t(osd_sum.kb_used << 10)
-      << si_t(osd_sum.kb_avail << 10)
-      << si_t(osd_sum.kb << 10)
+      << byte_u_t(osd_sum.kb_used << 10)
+      << byte_u_t(osd_sum.kb_avail << 10)
+      << byte_u_t(osd_sum.kb << 10)
       << TextTable::endrow;
 
   ss << tab;
@@ -1988,9 +1988,9 @@ void PGMap::dump_osd_sum_stats(ostream& ss) const
   tab.define_column("TOTAL", TextTable::LEFT, TextTable::RIGHT);
 
   tab << "sum"
-      << si_t(osd_sum.kb_used << 10)
-      << si_t(osd_sum.kb_avail << 10)
-      << si_t(osd_sum.kb << 10)
+      << byte_u_t(osd_sum.kb_used << 10)
+      << byte_u_t(osd_sum.kb_avail << 10)
+      << byte_u_t(osd_sum.kb << 10)
       << TextTable::endrow;
 
   ss << tab;
@@ -2937,9 +2937,9 @@ void PGMap::get_health_checks(
          p.second.target_max_objects * (ratio / 1000000.0)) {
        ostringstream ss;
        ss << "cache pool '" << name << "' with "
-          << si_t(st.stats.sum.num_objects)
+          << si_u_t(st.stats.sum.num_objects)
           << " objects at/near target max "
-          << si_t(p.second.target_max_objects) << " objects";
+          << si_u_t(p.second.target_max_objects) << " objects";
        detail.push_back(ss.str());
        nearfull = true;
       }
@@ -2949,9 +2949,9 @@ void PGMap::get_health_checks(
          p.second.target_max_bytes * (ratio / 1000000.0)) {
        ostringstream ss;
        ss << "cache pool '" << name
-          << "' with " << si_t(st.stats.sum.num_bytes)
-          << "B at/near target max "
-          << si_t(p.second.target_max_bytes) << "B";
+          << "' with " << byte_u_t(st.stats.sum.num_bytes)
+          << " at/near target max "
+          << byte_u_t(p.second.target_max_bytes);
        detail.push_back(ss.str());
        nearfull = true;
       }
@@ -3093,15 +3093,15 @@ void PGMap::get_health_checks(
        } else if (crit_threshold > 0 &&
                   sum.num_bytes >= pool.quota_max_bytes*crit_threshold) {
          ss << "pool '" << pool_name
-            << "' has " << si_t(sum.num_bytes) << " bytes"
-            << " (max " << si_t(pool.quota_max_bytes) << ")";
+            << "' has " << byte_u_t(sum.num_bytes)
+            << " (max " << byte_u_t(pool.quota_max_bytes) << ")";
          full_detail.push_back(ss.str());
          full = true;
        } else if (warn_threshold > 0 &&
                   sum.num_bytes >= pool.quota_max_bytes*warn_threshold) {
          ss << "pool '" << pool_name
-            << "' has " << si_t(sum.num_bytes) << " bytes"
-            << " (max " << si_t(pool.quota_max_bytes) << ")";
+            << "' has " << byte_u_t(sum.num_bytes)
+            << " (max " << byte_u_t(pool.quota_max_bytes) << ")";
          nearfull_detail.push_back(ss.str());
          nearfull = true;
        }
@@ -3652,9 +3652,9 @@ void PGMap::get_health(
       if (detail) {
        ostringstream ss;
        ss << "cache pool '" << name << "' with "
-          << si_t(st.stats.sum.num_objects)
+          << si_u_t(st.stats.sum.num_objects)
           << " objects at/near target max "
-          << si_t(p->second.target_max_objects) << " objects";
+          << si_u_t(p->second.target_max_objects) << " objects";
        detail->push_back(make_pair(HEALTH_WARN, ss.str()));
       }
     }
@@ -3666,9 +3666,9 @@ void PGMap::get_health(
       if (detail) {
        ostringstream ss;
        ss << "cache pool '" << name
-          << "' with " << si_t(st.stats.sum.num_bytes)
+          << "' with " << byte_u_t(st.stats.sum.num_bytes)
           << "B at/near target max "
-          << si_t(p->second.target_max_bytes) << "B";
+          << byte_u_t(p->second.target_max_bytes) << "B";
        detail->push_back(make_pair(HEALTH_WARN, ss.str()));
       }
     }
@@ -3806,14 +3806,14 @@ void PGMap::get_health(
       } else if (crit_threshold > 0 &&
                 sum.num_bytes >= pool.quota_max_bytes*crit_threshold) {
         ss << "pool '" << pool_name
-           << "' has " << si_t(sum.num_bytes) << " bytes"
-           << " (max " << si_t(pool.quota_max_bytes) << ")";
+           << "' has " << byte_u_t(sum.num_bytes) << " bytes"
+           << " (max " << byte_u_t(pool.quota_max_bytes) << ")";
         status = HEALTH_ERR;
       } else if (warn_threshold > 0 &&
                 sum.num_bytes >= pool.quota_max_bytes*warn_threshold) {
         ss << "pool '" << pool_name
-           << "' has " << si_t(sum.num_bytes) << " bytes"
-           << " (max " << si_t(pool.quota_max_bytes) << ")";
+           << "' has " << byte_u_t(sum.num_bytes) << " bytes"
+           << " (max " << byte_u_t(pool.quota_max_bytes) << ")";
         status = HEALTH_WARN;
       }
       if (status != HEALTH_OK) {