mirror of
https://github.com/ceph/ceph
synced 2025-02-24 19:47:44 +00:00
mon: Add mgr version collector
Signed-off-by: David Zafman <dzafman@redhat.com>
This commit is contained in:
parent
4b8b26d640
commit
bda3eaea56
@ -1290,6 +1290,18 @@ void MgrMonitor::count_metadata(const string& field, Formatter *f)
|
||||
f->close_section();
|
||||
}
|
||||
|
||||
void MgrMonitor::get_versions(std::map<string, list<string> > &versions)
|
||||
{
|
||||
std::set<string> ls = map.get_all_names();
|
||||
for (auto& name : ls) {
|
||||
std::map<string,string> meta;
|
||||
load_metadata(name, meta, nullptr);
|
||||
auto p = meta.find("ceph_version_short");
|
||||
if (p == meta.end()) continue;
|
||||
versions[p->second].push_back(string("mgr.") + name);
|
||||
}
|
||||
}
|
||||
|
||||
int MgrMonitor::dump_metadata(const string& name, Formatter *f, ostream *err)
|
||||
{
|
||||
std::map<string,string> m;
|
||||
|
@ -129,6 +129,7 @@ public:
|
||||
void print_nodes(ceph::Formatter *f) const;
|
||||
void count_metadata(const std::string& field, ceph::Formatter *f);
|
||||
void count_metadata(const std::string& field, std::map<std::string,int> *out);
|
||||
void get_versions(std::map<string, list<string> > &versions);
|
||||
|
||||
// When did the mon last call into our tick() method? Used for detecting
|
||||
// when the mon was not updating us for some period (e.g. during slow
|
||||
|
@ -5365,6 +5365,8 @@ void Monitor::get_all_versions(std::map<string, list<string> > &versions)
|
||||
get_versions(versions);
|
||||
// osd
|
||||
osdmon()->get_versions(versions);
|
||||
// mgr
|
||||
mgrmon()->get_versions(versions);
|
||||
dout(20) << __func__ << " all versions=" << versions << dendl;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user