diff options
Diffstat (limited to 'lib/top_block_stats.cpp')
-rw-r--r-- | lib/top_block_stats.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/top_block_stats.cpp b/lib/top_block_stats.cpp index 76e87ad..8cbdb0c 100644 --- a/lib/top_block_stats.cpp +++ b/lib/top_block_stats.cpp @@ -24,8 +24,18 @@ struct GetStatsReceiver : Theron::Receiver std::string TopBlock::get_stats(const std::string &) { + //get stats with custom receiver and set high prio GetStatsReceiver receiver; - (*this)->executor->post_all(GetStatsMessage(), receiver); + size_t outstandingCount(0); + BOOST_FOREACH(Apology::Worker *worker, (*this)->executor->get_workers()) + { + dynamic_cast<BlockActor *>(worker)->prio_count.Increment(); + worker->Push(GetStatsMessage(), receiver.GetAddress()); + outstandingCount++; + } + while (outstandingCount) outstandingCount -= receiver.Wait(outstandingCount); + + //now format the xml result std::string xml; xml += str(boost::format(" <now>%llu</now>\n") % time_now()); xml += str(boost::format(" <tps>%llu</tps>\n") % time_tps()); |