Skip to content

Commit

Permalink
mds: add inter-mds operations to PerfCounter
Browse files Browse the repository at this point in the history
Fixes: http://tracker.ceph.com/issues/20760

Signed-off-by: Patrick Donnelly <[email protected]>
  • Loading branch information
batrick committed Aug 2, 2017
1 parent e27a78c commit 56cf8cb
Show file tree
Hide file tree
Showing 4 changed files with 64 additions and 24 deletions.
34 changes: 34 additions & 0 deletions src/mds/MDCache.cc
Original file line number Diff line number Diff line change
Expand Up @@ -9081,6 +9081,27 @@ void MDCache::request_finish(MDRequestRef& mdr)
return;
}

switch(mdr->internal_op) {
case CEPH_MDS_OP_FRAGMENTDIR:
logger->inc(l_mdss_ireq_fragmentdir);
break;
case CEPH_MDS_OP_EXPORTDIR:
logger->inc(l_mdss_ireq_exportdir);
break;
case CEPH_MDS_OP_ENQUEUE_SCRUB:
logger->inc(l_mdss_ireq_enqueue_scrub);
break;
case CEPH_MDS_OP_FLUSH:
logger->inc(l_mdss_ireq_flush);
break;
case CEPH_MDS_OP_REPAIR_FRAGSTATS:
logger->inc(l_mdss_ireq_fragstats);
break;
case CEPH_MDS_OP_REPAIR_INODESTATS:
logger->inc(l_mdss_ireq_inodestats);
break;
}

request_cleanup(mdr);
}

Expand Down Expand Up @@ -12362,6 +12383,19 @@ void MDCache::register_perfcounters()
pcb.add_u64_counter(l_mdc_recovery_completed, "recovery_completed",
"File recoveries completed", "recd", PerfCountersBuilder::PRIO_INTERESTING);

pcb.add_u64_counter(l_mdss_ireq_enqueue_scrub, "ireq_enqueue_scrub",
"Internal Request type enqueue scrub");
pcb.add_u64_counter(l_mdss_ireq_exportdir, "ireq_exportdir",
"Internal Request type export dir");
pcb.add_u64_counter(l_mdss_ireq_flush, "ireq_flush",
"Internal Request type flush");
pcb.add_u64_counter(l_mdss_ireq_fragmentdir, "ireq_fragmentdir",
"Internal Request type fragmentdir");
pcb.add_u64_counter(l_mdss_ireq_fragstats, "ireq_fragstats",
"Internal Request type frag stats");
pcb.add_u64_counter(l_mdss_ireq_inodestats, "ireq_inodestats",
"Internal Request type inode stats");

logger.reset(pcb.create_perf_counters());
g_ceph_context->get_perfcounters_collection()->add(logger.get());
recovery_queue.set_logger(logger.get());
Expand Down
7 changes: 7 additions & 0 deletions src/mds/MDCache.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,13 @@ enum {
// How many inodes ever completed size recovery
l_mdc_recovery_completed,

l_mdss_ireq_enqueue_scrub,
l_mdss_ireq_exportdir,
l_mdss_ireq_flush,
l_mdss_ireq_fragmentdir,
l_mdss_ireq_fragstats,
l_mdss_ireq_inodestats,

l_mdc_last,
};

Expand Down
1 change: 0 additions & 1 deletion src/mds/Server.cc
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ using namespace std;
#undef dout_prefix
#define dout_prefix *_dout << "mds." << mds->get_nodeid() << ".server "


class ServerContext : public MDSInternalContextBase {
protected:
Server *server;
Expand Down
46 changes: 23 additions & 23 deletions src/mds/Server.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,39 +31,39 @@ class MDLog;

enum {
l_mdss_first = 1000,
l_mdss_dispatch_client_request,
l_mdss_dispatch_slave_request,
l_mdss_handle_client_request,
l_mdss_handle_slave_request,
l_mdss_handle_client_session,
l_mdss_dispatch_client_request,
l_mdss_handle_slave_request,
l_mdss_req_create,
l_mdss_req_getattr,
l_mdss_req_getfilelock,
l_mdss_req_link,
l_mdss_req_lookup,
l_mdss_req_lookuphash,
l_mdss_req_lookupino,
l_mdss_req_lookupparent,
l_mdss_req_lookupname,
l_mdss_req_lookup,
l_mdss_req_lookupparent,
l_mdss_req_lookupsnap,
l_mdss_req_getattr,
l_mdss_req_lssnap,
l_mdss_req_mkdir,
l_mdss_req_mknod,
l_mdss_req_mksnap,
l_mdss_req_open,
l_mdss_req_readdir,
l_mdss_req_rename,
l_mdss_req_renamesnap,
l_mdss_req_rmdir,
l_mdss_req_rmsnap,
l_mdss_req_rmxattr,
l_mdss_req_setattr,
l_mdss_req_setlayout,
l_mdss_req_setdirlayout,
l_mdss_req_setxattr,
l_mdss_req_rmxattr,
l_mdss_req_readdir,
l_mdss_req_setfilelock,
l_mdss_req_getfilelock,
l_mdss_req_create,
l_mdss_req_open,
l_mdss_req_mknod,
l_mdss_req_link,
l_mdss_req_unlink,
l_mdss_req_rmdir,
l_mdss_req_rename,
l_mdss_req_mkdir,
l_mdss_req_setlayout,
l_mdss_req_setxattr,
l_mdss_req_symlink,
l_mdss_req_lssnap,
l_mdss_req_mksnap,
l_mdss_req_rmsnap,
l_mdss_req_renamesnap,
l_mdss_dispatch_slave_request,
l_mdss_req_unlink,
l_mdss_last,
};

Expand Down

0 comments on commit 56cf8cb

Please sign in to comment.