From 70236dbfa6cd2a3eddf20a44d4bb2d6af268c2e0 Mon Sep 17 00:00:00 2001 From: Asias He Date: Thu, 16 Jul 2015 11:11:02 +0800 Subject: [PATCH] messaging_service: Add shard_info::get_stats helper Will be used in api/messaging_service.cc. --- message/messaging_service.cc | 4 ++++ message/messaging_service.hh | 1 + 2 files changed, 5 insertions(+) diff --git a/message/messaging_service.cc b/message/messaging_service.cc index 4c91443749..6956f5a270 100644 --- a/message/messaging_service.cc +++ b/message/messaging_service.cc @@ -138,6 +138,10 @@ messaging_service::shard_info::shard_info(std::unique_ptrget_stats(); +} + void messaging_service::foreach_client(std::function f) const { for (auto i = _clients.cbegin(); i != _clients.cend(); i++) { f(i->first, i->second); diff --git a/message/messaging_service.hh b/message/messaging_service.hh index e49e94d2d9..a118fdfe42 100644 --- a/message/messaging_service.hh +++ b/message/messaging_service.hh @@ -305,6 +305,7 @@ public: struct shard_info { shard_info(std::unique_ptr&& client); std::unique_ptr rpc_client; + rpc::stats get_stats() const; }; void foreach_client(std::function f) const;