Gizmod::CPUUsage Class Reference

CPU Usage monitor. More...

#include <CPUUsage.hpp>

Inheritance diagram for Gizmod::CPUUsage:

Inheritance graph

List of all members.

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 ()


struct  CPUUsageThreadProc

Detailed Description

CPU Usage monitor.

Definition at line 113 of file CPUUsage.hpp.

Constructor & Destructor Documentation

CPUUsage::CPUUsage (  ) 

Default Constructor.

CPUUsage Default Constructor.

Definition at line 72 of file CPUUsage.cpp.

References DEFAULT_UPDATE_DELAY, and getNumCPUs().

CPUUsage::~CPUUsage (  )  [virtual]


CPUUsage Destructor.

Definition at line 92 of file CPUUsage.cpp.

References shutdown().

Member Function Documentation

size_t CPUUsage::getNumCPUs (  ) 

Get the number of CPUs on the system.

The number of CPUs

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().

The documentation for this class was generated from the following files:
Generated on Wed Nov 7 10:07:00 2007 for gizmod by  doxygen 1.5.3