#ifdef STATISTICS
/*
 * $Id$
 *
 * [ Description ]
 * 
 */

#include "Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Write_unit/Write_unit/Execute_queue/include/Execute_queue.h"

namespace morpheo {
namespace behavioural {
namespace core {
namespace multi_execute_loop {
namespace execute_loop {
namespace multi_write_unit {
namespace write_unit {
namespace execute_queue {


#undef  FUNCTION
#define FUNCTION "Execute_queue::statistics_declaration"
  void Execute_queue::statistics_declaration (morpheo::behavioural::Parameters_Statistics * param_statistics)
  {
    log_printf(FUNC,Execute_queue,FUNCTION,"Begin");

    _stat = new Stat (static_cast<std::string>(_name),
		      "Execute_queue",
		      param_statistics);
    
    _stat_use_queue         = _stat->create_variable("use_queue");
    _stat_average_use_queue = _stat->create_counter ("average_use_queue", "" , "Average by cycle of the execute_queue occupation.");
    _stat_percent_use_queue = _stat->create_counter ("percent_use_queue", "%", "Percent of execute_queue usage.");

    _stat->create_expr("average_use_queue", "/ use_queue cycle"      , false);
    _stat->create_expr("percent_use_queue", "/ * average_use_queue 100 "+toString(_param->_size_queue), false);

    log_printf(FUNC,Execute_queue,FUNCTION,"End");
  };

}; // end namespace execute_queue
}; // end namespace write_unit
}; // end namespace multi_write_unit
}; // end namespace execute_loop
}; // end namespace multi_execute_loop
}; // end namespace core

}; // end namespace behavioural
}; // end namespace morpheo              
#endif
