#include <LoadMonitor.h>
Public Member Functions | |
LoadMonitor (void) | |
Ctor. | |
~LoadMonitor (void) | |
Dtor. | |
bool | Initialize (void) |
Initialize all counters. | |
bool | Terminate (void) |
Free all resources and disconnect from WMI provider. | |
LoadSample | TakeSample (void) |
Take performance sample. | |
HardwareDescription | GetHardwareDescription (void) |
Get hardware description. | |
Private Member Functions | |
LoadMonitor & | operator= (LoadMonitor &) |
Assignment. | |
LoadMonitor (const LoadMonitor &) | |
Prevent copying of the monitor. | |
void | LogInfo (const char *message) const |
Log info message to the output. | |
void | LogError (const char *message) const |
Log error message to the output. | |
unsigned long long | GetTSC (void) const |
Get CPU TSC. | |
Static Private Member Functions | |
static unsigned long long | GetSampleTime () |
Get current time in 100 ns intervals since Windows epoch. | |
Private Attributes | |
MemoryStats | memory |
Memory stats collector. | |
ProcessorStats | processor |
Processor stats collector. | |
NetworkStats | network |
Network stats collector. | |
SystemStats | system |
System stats collector. | |
DriveStats | drive |
Drive stats collector. | |
Data Structures | |
class | DriveStats |
Collects data about drive usage on the host. More... | |
class | MemoryStats |
Collects data about memory usage. More... | |
class | NetworkStats |
Collects data about network traffic on the computer. More... | |
class | ProcessorStats |
Collects data about processor usage. More... | |
class | StatsProvider |
Helper class which provides base for all stats providers. More... | |
class | SystemStats |
Collects various data about current system. More... |
This class collects all data about system utilization. Most of the data are read from the files in /proc directory. Kernel 2.5.70 or newer is required for all features to work. On older kernels some data may not be available.
lm::LoadMonitor::LoadMonitor | ( | void | ) |
Ctor.
lm::LoadMonitor::~LoadMonitor | ( | void | ) |
Dtor.
lm::LoadMonitor::LoadMonitor | ( | const LoadMonitor & | ) | [inline, private] |
Prevent copying of the monitor.
HardwareDescription lm::LoadMonitor::GetHardwareDescription | ( | void | ) |
Get hardware description.
unsigned long long lm::LoadMonitor::GetSampleTime | ( | void | ) | [static, private] |
Get current time in 100 ns intervals since Windows epoch.
This method uses clock_gettime function as a primary source of the time information. This function is available only on newer kernels (2.6) with sufficiently new libc (version 6 works fine).
unsigned long long lm::LoadMonitor::GetTSC | ( | void | ) | const [inline, private] |
Get CPU TSC.
bool lm::LoadMonitor::Initialize | ( | void | ) |
Initialize all counters.
void lm::LoadMonitor::LogError | ( | const char * | message | ) | const [private] |
Log error message to the output.
message | Message to write out. |
void lm::LoadMonitor::LogInfo | ( | const char * | message | ) | const [private] |
Log info message to the output.
message | Message to write out. |
LoadMonitor& lm::LoadMonitor::operator= | ( | LoadMonitor & | ) | [inline, private] |
Assignment.
LoadSample lm::LoadMonitor::TakeSample | ( | void | ) |
Take performance sample.
bool lm::LoadMonitor::Terminate | ( | void | ) |
Free all resources and disconnect from WMI provider.
DriveStats lm::LoadMonitor::drive [private] |
Drive stats collector.
MemoryStats lm::LoadMonitor::memory [private] |
Memory stats collector.
NetworkStats lm::LoadMonitor::network [private] |
Network stats collector.
ProcessorStats lm::LoadMonitor::processor [private] |
Processor stats collector.
SystemStats lm::LoadMonitor::system [private] |
System stats collector.