From 9191fbce9f4d161e4f871231469ef009c86f177f Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Tue, 12 Feb 2013 21:43:27 -0800 Subject: gras: working on block stats --- lib/gras_impl/block_actor.hpp | 14 +++++++++++--- lib/gras_impl/debug.hpp | 32 +------------------------------- 2 files changed, 12 insertions(+), 34 deletions(-) (limited to 'lib/gras_impl') 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 > 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 - -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*/ -- cgit