diff options
author | Josh Blum | 2013-03-04 02:08:50 -0600 |
---|---|---|
committer | Josh Blum | 2013-03-04 02:08:50 -0600 |
commit | e2268f682b77fdff1db5ddc6c410e226eb3dc1d5 (patch) | |
tree | 82c03c9f1c6d13530dee211fd4548a63dc28d9ed /lib/gras_impl | |
parent | 38faea0f72741f7732f6973b266ed623ff1428a4 (diff) | |
download | sandhi-e2268f682b77fdff1db5ddc6c410e226eb3dc1d5.tar.gz sandhi-e2268f682b77fdff1db5ddc6c410e226eb3dc1d5.tar.bz2 sandhi-e2268f682b77fdff1db5ddc6c410e226eb3dc1d5.zip |
stats: sweet pie charts for per block stats
Diffstat (limited to 'lib/gras_impl')
-rw-r--r-- | lib/gras_impl/stats.hpp | 35 |
1 files changed, 34 insertions, 1 deletions
diff --git a/lib/gras_impl/stats.hpp b/lib/gras_impl/stats.hpp index 9c9c8e1..0514f90 100644 --- a/lib/gras_impl/stats.hpp +++ b/lib/gras_impl/stats.hpp @@ -11,6 +11,19 @@ namespace gras struct BlockStats { + BlockStats(void) + { + start_time = 0; + stop_time = 0; + work_count = 0; + time_last_work = 0; + total_time_prep = 0; + total_time_work = 0; + total_time_post = 0; + total_time_input = 0; + total_time_output = 0; + } + time_ticks_t start_time; time_ticks_t stop_time; @@ -21,8 +34,28 @@ struct BlockStats item_index_t work_count; time_ticks_t time_last_work; + time_ticks_t total_time_prep; time_ticks_t total_time_work; - time_ticks_t total_time_work_other; + time_ticks_t total_time_post; + time_ticks_t total_time_input; + time_ticks_t total_time_output; +}; + +struct TimerAccumulate +{ + TimerAccumulate(time_ticks_t &accum): + accum(accum), t0(time_now()){} + ~TimerAccumulate(void) + { + if (t0) this->done(); + } + void done(void) + { + accum += (time_now()-t0); + t0 = 0; + } + time_ticks_t &accum; + time_ticks_t t0; }; } //namespace gras |