#include <CPUUsage.hpp>
Public Member Functions | |
size_t | getNumCPUs () |
Get the number of CPUs on the system. | |
void | init () |
Start watching! | |
virtual void | onCPUUsage (std::vector< boost::shared_ptr< CPUUsageInfo > > const &Event) |
Event triggered when CPU Usage stats are updated. | |
void | setTimeBetweenUpdates (float Seconds) |
Time between updates in seconds. | |
void | shutdown () |
Shutodwn the CPU Usage monitor. | |
CPUUsage () | |
Default Constructor. | |
virtual | ~CPUUsage () |
Destructor. | |
Classes | |
struct | CPUUsageThreadProc |
Definition at line 113 of file CPUUsage.hpp.
CPUUsage::CPUUsage | ( | ) |
Default Constructor.
CPUUsage Default Constructor.
Definition at line 72 of file CPUUsage.cpp.
References DEFAULT_UPDATE_DELAY, and getNumCPUs().
CPUUsage::~CPUUsage | ( | ) | [virtual] |
size_t CPUUsage::getNumCPUs | ( | ) |
Get the number of CPUs on the system.
Definition at line 110 of file CPUUsage.cpp.
References cdbg, and PROC_STAT_PATH.
Referenced by CPUUsage(), and init().
void CPUUsage::init | ( | ) |
Start watching!
Start the Usage watcher thread.
Definition at line 146 of file CPUUsage.cpp.
References cdbg, getNumCPUs(), and PROC_STAT_PATH.
void CPUUsage::onCPUUsage | ( | std::vector< boost::shared_ptr< CPUUsageInfo > > const & | Event | ) | [virtual] |
Event triggered when CPU Usage stats are updated.
Event | A vector of CPU Usage info, where index 0 is ALL processors, 1 is proc 1, 2 is cpu 2, etc |
Definition at line 160 of file CPUUsage.cpp.
void CPUUsage::setTimeBetweenUpdates | ( | float | Seconds | ) |
Time between updates in seconds.
Set the time between updates in seconds.
Seconds | Number of seconds between updates |
Definition at line 168 of file CPUUsage.cpp.
void CPUUsage::shutdown | ( | ) |
Shutodwn the CPU Usage monitor.
Shutdown the CPUUsage watcher.
Definition at line 175 of file CPUUsage.cpp.
References cdbg5.
Referenced by ~CPUUsage().