summaryrefslogtreecommitdiff
path: root/lib/block.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.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.cpp')
-rw-r--r--lib/block.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/block.cpp b/lib/block.cpp
index 330e1a6..424df83 100644
--- a/lib/block.cpp
+++ b/lib/block.cpp
@@ -164,16 +164,17 @@ void Block::produce(const size_t num_items)
item_index_t Block::get_consumed(const size_t which_input)
{
- return (*this)->block->items_consumed[which_input];
+ return (*this)->block->stats.items_consumed[which_input];
}
item_index_t Block::get_produced(const size_t which_output)
{
- return (*this)->block->items_produced[which_output];
+ return (*this)->block->stats.items_produced[which_output];
}
void Block::post_output_tag(const size_t which_output, const Tag &tag)
{
+ (*this)->block->stats.items_produced[which_output]++;
(*this)->block->post_downstream(which_output, InputTagMessage(tag));
}
@@ -194,6 +195,7 @@ PMCC Block::pop_input_msg(const size_t which_input)
if (input_tags.empty()) return PMCC();
PMCC p = input_tags.front().object;
input_tags.erase(input_tags.begin());
+ (*this)->block->stats.items_consumed[which_input]++;
return p;
}