summaryrefslogtreecommitdiff
path: root/lib/block.cpp
diff options
context:
space:
mode:
authorJosh Blum2013-02-17 23:01:03 -0600
committerJosh Blum2013-02-17 23:01:03 -0600
commitf8cca035aacf1578b99f6ffa1bb99ffb052ac27c (patch)
tree37f906338284ec6a48886079f4d8621549b0971b /lib/block.cpp
parentafd0575bc2eef7f2a97c8ce4cadb328ceb491d10 (diff)
downloadsandhi-f8cca035aacf1578b99f6ffa1bb99ffb052ac27c.tar.gz
sandhi-f8cca035aacf1578b99f6ffa1bb99ffb052ac27c.tar.bz2
sandhi-f8cca035aacf1578b99f6ffa1bb99ffb052ac27c.zip
gras: added stats for produced/consumed
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 716873b..f5ba6ce 100644
--- a/lib/block.cpp
+++ b/lib/block.cpp
@@ -142,16 +142,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));
}
@@ -172,6 +173,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;
}