libcommonc++
0.7
|
System CPU utilization statistics. More...
#include <CPUStats.h++>
Public Member Functions | |
CPUStats () | |
Construct a new CPUStats object. More... | |
~CPUStats () | |
Destructor. More... | |
float | getSystem (int cpu=-1) const |
Get the percent of CPU time spent in privileged (kernel) mode. More... | |
float | getUser (int cpu=-1) const |
Get the percent of CPU time spent in unprivileged (user) mode. More... | |
float | getNice (int cpu=-1) const |
Get the percent of CPU time spent on low-priority tasks. More... | |
float | getIdle (int cpu=-1) const |
Get the percent of CPU time spent on the idle task. More... | |
uint_t | getCPUCount () const |
Get the number of CPUs in the system. More... | |
bool | collect () |
Collect (update) the stats represented by this object. More... | |
void | reset () |
Reset the stats object. More... | |
System CPU utilization statistics.
~CPUStats | ( | ) |
Destructor.
|
virtual |
Collect (update) the stats represented by this object.
Implements SystemStats.
|
inline |
Get the number of CPUs in the system.
float getIdle | ( | int | cpu = -1 | ) | const |
Get the percent of CPU time spent on the idle task.
cpu | The CPU number or -1 for the average across all CPUs. |
OutOfBoundsException | If the value of cpu is invalid. |
float getNice | ( | int | cpu = -1 | ) | const |
Get the percent of CPU time spent on low-priority tasks.
cpu | The CPU number or -1 for the average across all CPUs. |
OutOfBoundsException | If the value of cpu is invalid. |
float getSystem | ( | int | cpu = -1 | ) | const |
Get the percent of CPU time spent in privileged (kernel) mode.
cpu | The CPU number or -1 for the average across all CPUs. |
OutOfBoundsException | If the value of cpu is invalid. |
float getUser | ( | int | cpu = -1 | ) | const |
Get the percent of CPU time spent in unprivileged (user) mode.
cpu | The CPU number or -1 for the average across all CPUs. |
OutOfBoundsException | If the value of cpu is invalid. |
|
virtual |
Reset the stats object.
Implements SystemStats.