}
}
+void FSMap::print_fs_summary(ostream& out) const
+{
+ if (!filesystems.empty()) {
+ int num_failed = 0, num_recovering = 0, num_stopped = 0, num_healthy = 0;
+ int num_damaged = 0;
+ for (auto& [fscid, fs] : filesystems) {
+ if (fs->mds_map.is_any_damaged()) {
+ ++num_damaged;
+ }
+ if (fs->mds_map.is_any_failed()) {
+ ++num_failed;
+ } else if (fs->mds_map.is_degraded()) {
+ ++num_recovering;
+ } else if (fs->mds_map.get_max_mds() == 0) {
+ ++num_stopped;
+ } else {
+ ++num_healthy;
+ }
+ }
+ out << " volumes: "
+ << num_healthy << "/" << filesystems.size() << " healthy";
+ if (num_recovering) {
+ out << ", " << num_recovering << " recovering";
+ }
+ if (num_failed) {
+ out << ", " << num_failed << " failed";
+ }
+ if (num_stopped) {
+ out << ", " << num_stopped << " stopped";
+ }
+ if (num_damaged) {
+ out << "; " << num_damaged << " damaged";
+ }
+ out << "\n";
+ }
+}
+
void FSMap::print_summary(Formatter *f, ostream *out) const
{
if (f) {
void print(std::ostream& out) const;
void print_summary(ceph::Formatter *f, std::ostream *out) const;
+ void print_fs_summary(std::ostream& out) const;
void dump(ceph::Formatter *f) const;
static void generate_test_instances(std::list<FSMap*>& ls);
void get_failed_mds_set(std::set<mds_rank_t>& s) const {
s = failed;
}
+ void get_damaged_mds_set(std::set<mds_rank_t>& s) const {
+ s = damaged;
+ }
// features
uint64_t get_up_features();
// recovery_set.
bool is_degraded() const;
bool is_any_failed() const {
- return failed.size();
+ return !failed.empty();
+ }
+ bool is_any_damaged() const {
+ return !damaged.empty();
}
bool is_resolving() const {
return
void count_metadata(const std::string& field, ceph::Formatter *f);
public:
+ void print_fs_summary(ostream& out) {
+ get_fsmap().print_fs_summary(out);
+ }
void count_metadata(const std::string& field, std::map<std::string,int> *out);
void get_versions(std::map<std::string, std::list<std::string>> &versions);
}
ss << "\n \n data:\n";
+ mdsmon()->print_fs_summary(ss);
mgrstatmon()->print_summary(NULL, &ss);
auto& pem = mgrstatmon()->get_progress_events();