summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/block_handlers.cpp1
-rw-r--r--lib/gras_impl/input_buffer_queues.hpp3
-rw-r--r--lib/gras_impl/stats.hpp1
-rw-r--r--lib/top_block_query.cpp1
-rw-r--r--python/gras/query/chart_total_io_counts.js1
5 files changed, 7 insertions, 0 deletions
diff --git a/lib/block_handlers.cpp b/lib/block_handlers.cpp
index 318b734..d548ee0 100644
--- a/lib/block_handlers.cpp
+++ b/lib/block_handlers.cpp
@@ -148,6 +148,7 @@ void BlockActor::handle_get_stats(
this->stats.msgs_enqueued[i] = this->input_msgs[i].size();
}
this->stats.actor_queue_depth = this->GetNumQueuedMessages();
+ this->stats.bytes_copied = this->input_queues.bytes_copied;
//create the message reply object
GetStatsMessage message;
diff --git a/lib/gras_impl/input_buffer_queues.hpp b/lib/gras_impl/input_buffer_queues.hpp
index e45bc06..f9ae3a2 100644
--- a/lib/gras_impl/input_buffer_queues.hpp
+++ b/lib/gras_impl/input_buffer_queues.hpp
@@ -165,6 +165,7 @@ struct InputBufferQueues
std::vector<boost::circular_buffer<SBuffer> > _queues;
std::vector<size_t> _preload_bytes;
std::vector<boost::shared_ptr<SimpleBufferQueue> > _aux_queues;
+ std::vector<item_index_t> bytes_copied;
};
@@ -178,6 +179,7 @@ GRAS_FORCE_INLINE void InputBufferQueues::resize(const size_t size)
_preload_bytes.resize(size, 0);
_reserve_bytes.resize(size, 1);
_maximum_bytes.resize(size, MAX_AUX_BUFF_BYTES);
+ bytes_copied.resize(size);
}
inline void InputBufferQueues::update_config(
@@ -254,6 +256,7 @@ GRAS_FORCE_INLINE void InputBufferQueues::accumulate(const size_t i)
SBuffer &front = _queues[i].front();
const size_t bytes = std::min(front.length, free_bytes);
std::memcpy(accum_buff.get(accum_buff.length), front.get(), bytes);
+ bytes_copied[i] += bytes;
//std::cerr << "memcpy " << bytes << std::endl;
accum_buff.length += bytes;
free_bytes -= bytes;
diff --git a/lib/gras_impl/stats.hpp b/lib/gras_impl/stats.hpp
index a1b165a..a6d83ed 100644
--- a/lib/gras_impl/stats.hpp
+++ b/lib/gras_impl/stats.hpp
@@ -36,6 +36,7 @@ struct BlockStats
std::vector<item_index_t> items_produced;
std::vector<item_index_t> tags_produced;
std::vector<item_index_t> msgs_produced;
+ std::vector<item_index_t> bytes_copied;
//port starvation tracking
std::vector<time_ticks_t> inputs_idle;
diff --git a/lib/top_block_query.cpp b/lib/top_block_query.cpp
index a20704f..20e1c66 100644
--- a/lib/top_block_query.cpp
+++ b/lib/top_block_query.cpp
@@ -133,6 +133,7 @@ static std::string query_stats(ElementImpl *self, const boost::property_tree::pt
my_block_ptree_append(items_produced);
my_block_ptree_append(tags_produced);
my_block_ptree_append(msgs_produced);
+ my_block_ptree_append(bytes_copied);
blocks.push_back(std::make_pair(message.block_id, block));
}
root.push_back(std::make_pair("blocks", blocks));
diff --git a/python/gras/query/chart_total_io_counts.js b/python/gras/query/chart_total_io_counts.js
index 597de71..ac1fb0e 100644
--- a/python/gras/query/chart_total_io_counts.js
+++ b/python/gras/query/chart_total_io_counts.js
@@ -50,6 +50,7 @@ GrasChartTotalIoCounts.prototype.update = function(point)
['Output', 'items', 'items_produced'],
['Output', 'tags', 'tags_produced'],
['Output', 'msgs', 'msgs_produced'],
+ ['Copied', 'bytes', 'bytes_copied'],
];
$.each(stuff, function(contents_i, contents)