New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mon: {mon,osd,mds} {versions,count-metadata} #15436

Merged
merged 2 commits into from Jun 7, 2017

Conversation

Projects
None yet
3 participants
@liewegas
Member

liewegas commented Jun 2, 2017

gnit:build (wip-versions) 02:46 PM $ bin/ceph osd versions
{
    "ceph version 12.0.2-2073-gafcfc1d (afcfc1d7d99fae1697d687f65ce297de5c94b3a8) luminous (dev)": 3
}
gnit:build (wip-versions) 02:47 PM $ bin/ceph mds count-metadata kernel_version
{
    "4.8.8-300.fc25.x86_64": 1
}

also fix an accidental change to the ceph version string (extra space)

liewegas added some commits Jun 2, 2017

common/version: remove accidental space
Introduced in 32f10b3

Signed-off-by: Sage Weil <sage@redhat.com>
mon: implement '{mon,osd,mds} versions' and '{mon,osd,mds} count-meta…
…data <field>'

Summarize running versions of mon, osd, and mds daemons, or similarly
tabulate daemons by any other metadata property.

Signed-off-by: Sage Weil <sage@redhat.com>
@liewegas

This comment has been minimized.

Member

liewegas commented Jun 6, 2017

retest this please

@yuriw

This comment has been minimized.

Contributor

yuriw commented Jun 7, 2017

this was tested and approved for merge after review
@liewegas @tchaikov

@tchaikov

modulo the nits, lgtm.

@@ -4172,6 +4194,20 @@ bool OSDMonitor::preprocess_command(MonOpRequestRef op)
f->close_section();
}
f->flush(rdata);
} else if (prefix == "osd versions") {
if (!f)

This comment has been minimized.

@tchaikov

tchaikov Jun 7, 2017

Contributor

this is not necessary, f is always valid. see https://github.com/ceph/ceph/pull/15436/files#diff-0a5db46a44ae9900e226289a810f10e8R3975

  boost::scoped_ptr<Formatter> f(Formatter::create(format));
r = 0;
} else if (prefix == "osd count-metadata") {
if (!f)
f.reset(Formatter::create("json-pretty"));

This comment has been minimized.

@tchaikov

tchaikov Jun 7, 2017

Contributor

ditto.

@@ -3205,6 +3207,24 @@ void Monitor::handle_command(MonOpRequestRef op)
f->flush(ds);
rdata.append(ds);
rs = "";
} else if (prefix == "mon versions") {
if (!f)

This comment has been minimized.

@tchaikov

tchaikov Jun 7, 2017

Contributor

this is not necessary either.

  boost::scoped_ptr<Formatter> f(Formatter::create(format));
@@ -969,6 +969,20 @@ bool MDSMonitor::preprocess_command(MonOpRequestRef op)
f->close_section();
}
f->flush(ds);
} else if (prefix == "mds versions") {
if (!f)

This comment has been minimized.

@tchaikov

tchaikov Jun 7, 2017

Contributor

this is not necessary, either either.

This comment has been minimized.

@tchaikov

tchaikov Jun 8, 2017

Contributor

sorry, i was wrong, Formatter::create("plain") will return a nullptr.

@yuriw yuriw merged commit 17376db into ceph:master Jun 7, 2017

3 checks passed

Signed-off-by all commits in this PR are signed
Details
Unmodifed Submodules submodules for project are unmodified
Details
default Build finished.
Details
@tchaikov

This comment has been minimized.

Contributor

tchaikov commented Jun 7, 2017

i will send a cleanup PR as the follow-up of this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment