summaryrefslogtreecommitdiff
path: root/lib/block_handlers.cpp
diff options
context:
space:
mode:
authorJosh Blum2013-02-24 14:29:16 -0800
committerJosh Blum2013-02-24 14:29:16 -0800
commit883743bd59f40f9ce1e30bd196de78c2e7646294 (patch)
treef9b0cf4f0a1d3894643a681a54aa21fe55398243 /lib/block_handlers.cpp
parent6841702911d07a2bad86ecd3bfc243b6a688ad2a (diff)
parentdecd0f40714a71c6fb5c4f100e8f51c6ef238b26 (diff)
downloadsandhi-883743bd59f40f9ce1e30bd196de78c2e7646294.tar.gz
sandhi-883743bd59f40f9ce1e30bd196de78c2e7646294.tar.bz2
sandhi-883743bd59f40f9ce1e30bd196de78c2e7646294.zip
Merge branch 'stats'
Conflicts: grextras include/gras/top_block.hpp lib/block_handlers.cpp lib/block_task.cpp lib/element_impl.hpp tests/CMakeLists.txt
Diffstat (limited to 'lib/block_handlers.cpp')
-rw-r--r--lib/block_handlers.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/block_handlers.cpp b/lib/block_handlers.cpp
index 1290a67..73a22da 100644
--- a/lib/block_handlers.cpp
+++ b/lib/block_handlers.cpp
@@ -16,6 +16,7 @@ void BlockActor::handle_top_active(
if (this->block_state != BLOCK_STATE_LIVE)
{
this->block_ptr->notify_active();
+ this->stats.start_time = time_now();
}
this->block_state = BLOCK_STATE_LIVE;
this->active_token = message.token;
@@ -128,3 +129,14 @@ void BlockActor::handle_self_kick(
MESSAGE_TRACER();
this->handle_task();
}
+
+void BlockActor::handle_get_stats(
+ const GetStatsMessage &,
+ const Theron::Address from
+){
+ GetStatsMessage message;
+ message.block_id = this->block_ptr->to_string();
+ message.stats = this->stats;
+ message.stats_time = time_now();
+ this->Send(message, from); //ACK
+}