MCPcopy Create free account
hub / github.com/ceph/ceph / preprocess_getpoolstats

Method preprocess_getpoolstats

src/mon/MgrStatMonitor.cc:451–482  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

449}
450
451bool MgrStatMonitor::preprocess_getpoolstats(MonOpRequestRef op)
452{
453 op->mark_pgmon_event(__func__);
454 auto m = op->get_req<MGetPoolStats>();
455 auto session = op->get_session();
456 if (!session)
457 return true;
458 if (!session->is_capable("pg", MON_CAP_R)) {
459 dout(0) << "MGetPoolStats received from entity with insufficient caps "
460 << session->caps << dendl;
461 return true;
462 }
463 if (m->fsid != mon.monmap->fsid) {
464 dout(0) << __func__ << " on fsid "
465 << m->fsid << " != " << mon.monmap->fsid << dendl;
466 return true;
467 }
468 epoch_t ver = get_last_committed();
469 auto reply = new MGetPoolStatsReply(m->fsid, m->get_tid(), ver);
470 reply->per_pool = digest.use_per_pool_stats();
471 for (const auto& pool_name : m->pools) {
472 const auto pool_id = mon.osdmon()->osdmap.lookup_pg_pool_name(pool_name);
473 if (pool_id == -ENOENT)
474 continue;
475 auto pool_stat = get_pool_stat(pool_id);
476 if (!pool_stat)
477 continue;
478 reply->pool_stats[pool_name] = *pool_stat;
479 }
480 mon.send_reply(op, reply);
481 return true;
482}
483
484bool MgrStatMonitor::preprocess_statfs(MonOpRequestRef op)
485{

Callers

nothing calls this directly

Calls 8

mark_pgmon_eventMethod · 0.80
use_per_pool_statsMethod · 0.80
lookup_pg_pool_nameMethod · 0.80
osdmonMethod · 0.80
send_replyMethod · 0.80
get_sessionMethod · 0.45
is_capableMethod · 0.45
get_tidMethod · 0.45

Tested by

no test coverage detected