summaryrefslogtreecommitdiff
path: root/lib/top_block_query.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/top_block_query.cpp')
-rw-r--r--lib/top_block_query.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/top_block_query.cpp b/lib/top_block_query.cpp
index b000a2d..3203507 100644
--- a/lib/top_block_query.cpp
+++ b/lib/top_block_query.cpp
@@ -7,6 +7,7 @@
#include <boost/property_tree/json_parser.hpp>
#include <boost/property_tree/xml_parser.hpp>
#include <boost/regex.hpp>
+#include <Theron/DefaultAllocator.h>
#include <algorithm>
#include <sstream>
@@ -87,6 +88,15 @@ static std::string query_stats(ElementImpl *self, const boost::property_tree::pt
root.put("now", time_now());
root.put("tps", time_tps());
+ //allocator debugs
+ Theron::DefaultAllocator *allocator = dynamic_cast<Theron::DefaultAllocator *>(Theron::AllocatorManager::Instance().GetAllocator());
+ if (allocator)
+ {
+ root.put("bytes_allocated", allocator->GetBytesAllocated());
+ root.put("peak_bytes_allocated", allocator->GetPeakBytesAllocated());
+ root.put("allocation_count", allocator->GetAllocationCount());
+ }
+
//iterate through blocks
boost::property_tree::ptree blocks;
BOOST_FOREACH(const GetStatsMessage &message, receiver.messages)