CPUStats Class Reference

System CPU utilization statistics. More...

#include <CPUStats.h++>

Inheritance diagram for CPUStats:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 CPUStats ()
 Construct a new CPUStats object.
 ~CPUStats () throw ()
 Destructor.
float getSystem (int cpu=-1) const throw (OutOfBoundsException)
 Get the percent of CPU time spent in privileged (kernel) mode.
float getUser (int cpu=-1) const throw (OutOfBoundsException)
 Get the percent of CPU time spent in unprivileged (user) mode.
float getNice (int cpu=-1) const throw (OutOfBoundsException)
 Get the percent of CPU time spent on low-priority tasks.
float getIdle (int cpu=-1) const throw (OutOfBoundsException)
 Get the percent of CPU time spent on the idle task.
uint_t getCPUCount () const throw ()
 Get the number of CPUs in the system.
bool collect () throw ()
 Collect (update) the stats represented by this object.
void reset () throw ()
 Reset the stats object.

Detailed Description

System CPU utilization statistics.

Author:
Mark Lindner

Constructor & Destructor Documentation

CPUStats (  ) 

Construct a new CPUStats object.

~CPUStats (  )  throw ()

Destructor.


Member Function Documentation

bool collect (  )  throw () [virtual]

Collect (update) the stats represented by this object.

Returns:
true if the stats were collected successfully, false otherwise.

Implements SystemStats.

uint_t getCPUCount (  )  const throw () [inline]

Get the number of CPUs in the system.

float getIdle ( int  cpu = -1  )  const throw (OutOfBoundsException)

Get the percent of CPU time spent on the idle task.

Parameters:
cpu The CPU number or -1 for the average across all CPUs.
Exceptions:
OutOfBoundsException If the value of cpu is invalid.
float getNice ( int  cpu = -1  )  const throw (OutOfBoundsException)

Get the percent of CPU time spent on low-priority tasks.

Parameters:
cpu The CPU number or -1 for the average across all CPUs.
Exceptions:
OutOfBoundsException If the value of cpu is invalid.
float getSystem ( int  cpu = -1  )  const throw (OutOfBoundsException)

Get the percent of CPU time spent in privileged (kernel) mode.

Parameters:
cpu The CPU number or -1 for the average across all CPUs.
Exceptions:
OutOfBoundsException If the value of cpu is invalid.
float getUser ( int  cpu = -1  )  const throw (OutOfBoundsException)

Get the percent of CPU time spent in unprivileged (user) mode.

Parameters:
cpu The CPU number or -1 for the average across all CPUs.
Exceptions:
OutOfBoundsException If the value of cpu is invalid.
void reset (  )  throw () [virtual]

Reset the stats object.

Implements SystemStats.


The documentation for this class was generated from the following files:
Generated on Sat Nov 26 16:49:08 2011 for libcommonc++ by  doxygen 1.6.3