diff options
author | Tom Rondeau | 2013-02-15 16:24:39 -0500 |
---|---|---|
committer | Tom Rondeau | 2013-02-15 16:24:39 -0500 |
commit | d1735360bc7bfb04be56f2b255a0b84b4db31b84 (patch) | |
tree | 2a3e63cc9ec2a23418b72aacefdfbee883f56758 /gnuradio-core/src/lib/runtime/gr_block.cc | |
parent | 6408376d7a1b59533100870bd2d1c392bfbf7864 (diff) | |
download | gnuradio-d1735360bc7bfb04be56f2b255a0b84b4db31b84.tar.gz gnuradio-d1735360bc7bfb04be56f2b255a0b84b4db31b84.tar.bz2 gnuradio-d1735360bc7bfb04be56f2b255a0b84b4db31b84.zip |
core: adding variance calcs to perf. counters.
Using running mean/variance algorithm from Knuth's Art of Computer Programming.
Diffstat (limited to 'gnuradio-core/src/lib/runtime/gr_block.cc')
-rw-r--r-- | gnuradio-core/src/lib/runtime/gr_block.cc | 85 |
1 files changed, 85 insertions, 0 deletions
diff --git a/gnuradio-core/src/lib/runtime/gr_block.cc b/gnuradio-core/src/lib/runtime/gr_block.cc index f52f7a6ba..54d267620 100644 --- a/gnuradio-core/src/lib/runtime/gr_block.cc +++ b/gnuradio-core/src/lib/runtime/gr_block.cc @@ -282,6 +282,17 @@ gr_block::pc_noutput_items() } float +gr_block::pc_noutput_items_var() +{ + if(d_detail) { + return d_detail->pc_noutput_items_var(); + } + else { + return 0; + } +} + +float gr_block::pc_nproduced() { if(d_detail) { @@ -293,6 +304,17 @@ gr_block::pc_nproduced() } float +gr_block::pc_nproduced_var() +{ + if(d_detail) { + return d_detail->pc_nproduced_var(); + } + else { + return 0; + } +} + +float gr_block::pc_input_buffers_full(int which) { if(d_detail) { @@ -303,6 +325,17 @@ gr_block::pc_input_buffers_full(int which) } } +float +gr_block::pc_input_buffers_full_var(int which) +{ + if(d_detail) { + return d_detail->pc_input_buffers_full_var(static_cast<size_t>(which)); + } + else { + return 0; + } +} + std::vector<float> gr_block::pc_input_buffers_full() { @@ -314,6 +347,17 @@ gr_block::pc_input_buffers_full() } } +std::vector<float> +gr_block::pc_input_buffers_full_var() +{ + if(d_detail) { + return d_detail->pc_input_buffers_full_var(); + } + else { + return std::vector<float>(1,0); + } +} + float gr_block::pc_output_buffers_full(int which) { @@ -325,6 +369,17 @@ gr_block::pc_output_buffers_full(int which) } } +float +gr_block::pc_output_buffers_full_var(int which) +{ + if(d_detail) { + return d_detail->pc_output_buffers_full_var(static_cast<size_t>(which)); + } + else { + return 0; + } +} + std::vector<float> gr_block::pc_output_buffers_full() { @@ -336,6 +391,17 @@ gr_block::pc_output_buffers_full() } } +std::vector<float> +gr_block::pc_output_buffers_full_var() +{ + if(d_detail) { + return d_detail->pc_output_buffers_full_var(); + } + else { + return std::vector<float>(1,0); + } +} + float gr_block::pc_work_time() { @@ -347,6 +413,25 @@ gr_block::pc_work_time() } } +float +gr_block::pc_work_time_var() +{ + if(d_detail) { + return d_detail->pc_work_time_var(); + } + else { + return 0; + } +} + +void +gr_block::reset_perf_counters() +{ + if(d_detail) { + d_detail->reset_perf_counters(); + } +} + std::ostream& operator << (std::ostream& os, const gr_block *m) { |