diff options
Diffstat (limited to 'TAO/CIAO/DAnCE/NodeManager/CIAO_Monitor.cpp')
-rw-r--r-- | TAO/CIAO/DAnCE/NodeManager/CIAO_Monitor.cpp | 96 |
1 files changed, 0 insertions, 96 deletions
diff --git a/TAO/CIAO/DAnCE/NodeManager/CIAO_Monitor.cpp b/TAO/CIAO/DAnCE/NodeManager/CIAO_Monitor.cpp deleted file mode 100644 index 7c5485adf82..00000000000 --- a/TAO/CIAO/DAnCE/NodeManager/CIAO_Monitor.cpp +++ /dev/null @@ -1,96 +0,0 @@ -// $Id$ -//========================================================================== -/// The RSS Monitor class defination -/** - * @file CIAO_Monitor.cpp - * - * @brief The Monitor class defination - * - * @author Nilabja Roy <nilabjar@dre.vanderbilt.edu> - */ -//========================================================================== - -#include "CIAO_Monitor.h" -#include "CIAO_common.h" -#include "ace/OS_NS_stdio.h" - - -extern "C" ACE_Proper_Export_Flag CIAO::MonitorBase * CIAO::createMonitor () -{ - return new CIAO::CIAO_Monitor (); -} - -CIAO::CIAO_Monitor::CIAO_Monitor () -{ -} - -/// The Desctructor -CIAO::CIAO_Monitor::~CIAO_Monitor () -{ -} - -int CIAO::CIAO_Monitor::initialize_params ( - ::Deployment::Domain& domain, - ::Deployment::TargetManager_ptr target_manager, - int interval - ) -{ - current_domain_.reset (new ::Deployment::Domain (domain)); - target_ptr_= target_manager; - this->interval_=interval; - - return 0; -} - -int CIAO::CIAO_Monitor::start (CORBA::ORB_ptr) -{ - return 0; -} - -int CIAO::CIAO_Monitor::stop () -{ - return 0; -} - -::Deployment::Domain* CIAO::CIAO_Monitor::get_current_data () -{ - if (CIAO::debug_level () > 9) - { - ACE_DEBUG ((LM_DEBUG , "Inside the get_current_data")); - } - - float current_load; - - // get the load average value from the /proc/loadavg - - FILE *load_file = ACE_OS::fopen ("/proc/loadavg", "r"); - - if (load_file == 0) - { - // load file cannot be opened .. - current_load = 0; - } - else - { - fscanf (load_file, "%f", ¤t_load); - if (CIAO::debug_level () > 9) - { - ACE_DEBUG ((LM_DEBUG , "Current load is %d\n",current_load)); - } - } - - ACE_OS::fclose (load_file); - - CORBA::Any any; - any <<= current_load; - - current_domain_->node[0].resource[0].property[0].kind = ::Deployment::Quantity; - current_domain_->node[0].resource[0].property[0].value = any; - - if (CIAO::debug_level () > 9) - { - ACE_DEBUG ((LM_DEBUG , "Exiting from the get_current_data function\n")); - } - - return current_domain_.get (); -} |