#ifdef STATISTICS
/*
 * $Id: Write_queue_statistics_declaration.cpp 113 2009-04-14 18:39:12Z rosiere $
 *
 * [ Description ]
 * 
 */

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

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


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

    _stat = new Stat (static_cast<std::string>(_name),
		      _param->_type,
		      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 write_queue occupation.");
    _stat_percent_use_queue = _stat->create_counter ("percent_use_queue", "%", "Percent of write_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,Write_queue,FUNCTION,"End");
  };

}; // end namespace write_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
