diff options
author | Josh Blum | 2013-02-12 21:43:27 -0800 |
---|---|---|
committer | Josh Blum | 2013-02-17 20:53:28 -0600 |
commit | 9191fbce9f4d161e4f871231469ef009c86f177f (patch) | |
tree | c03be55bdd4047db0b82d550d0f6c4bb38cec1ec /lib/gras_impl | |
parent | 93afc6bff6ce58c08d8ae4b1509f682a05a9c59d (diff) | |
download | sandhi-9191fbce9f4d161e4f871231469ef009c86f177f.tar.gz sandhi-9191fbce9f4d161e4f871231469ef009c86f177f.tar.bz2 sandhi-9191fbce9f4d161e4f871231469ef009c86f177f.zip |
gras: working on block stats
Diffstat (limited to 'lib/gras_impl')
-rw-r--r-- | lib/gras_impl/block_actor.hpp | 14 | ||||
-rw-r--r-- | lib/gras_impl/debug.hpp | 32 |
2 files changed, 12 insertions, 34 deletions
diff --git a/lib/gras_impl/block_actor.hpp b/lib/gras_impl/block_actor.hpp index cec68be..ac0bf46 100644 --- a/lib/gras_impl/block_actor.hpp +++ b/lib/gras_impl/block_actor.hpp @@ -22,6 +22,16 @@ namespace gras { +struct BlockStats +{ + time_ticks_t start_time; + time_ticks_t stop_time; + + size_t work_count; + time_ticks_t total_time_work; + time_ticks_t total_time_work_other; +}; + struct BlockActor : Apology::Worker { BlockActor(void); @@ -172,9 +182,7 @@ struct BlockActor : Apology::Worker std::vector<std::vector<OutputHintMessage> > output_allocation_hints; - //status keepers - size_t handle_task_count; - size_t work_count; + BlockStats stats; }; } //namespace gras diff --git a/lib/gras_impl/debug.hpp b/lib/gras_impl/debug.hpp index 61376d5..c01e7d4 100644 --- a/lib/gras_impl/debug.hpp +++ b/lib/gras_impl/debug.hpp @@ -24,11 +24,9 @@ extern void *operator new(std::size_t n) throw (std::bad_alloc); //---------------------------------------------------------------------- //-- define to enable these debugs: //---------------------------------------------------------------------- -//#define WORK_DEBUG -//#define ASSERTING +#define ASSERTING //#define MESSAGE_TRACING //#define ITEM_CONSPROD -//#define WORK_COUNTS //---------------------------------------------------------------------- //-- time accumulation printer @@ -68,32 +66,4 @@ extern void *operator new(std::size_t n) throw (std::bad_alloc); #define ASSERT(x) #endif -//---------------------------------------------------------------------- -//-- implementation for work debug -//---------------------------------------------------------------------- -#ifdef WORK_DEBUG - -#include <boost/thread/mutex.hpp> - -static boost::mutex work_debug_mutex; - -struct WorkDebugPrinter -{ - WorkDebugPrinter(const std::string &name): - lock(work_debug_mutex), name(name) - { - std::cerr << "-----> begin work on " << name << std::endl; - } - - ~WorkDebugPrinter(void) - { - std::cerr << "<----- end work on " << name << std::endl; - } - - boost::mutex::scoped_lock lock; - std::string name; -}; - -#endif - #endif /*INCLUDED_LIBGRAS_IMPL_DEBUG_HPP*/ |